Skip to main content

Unknown page: <name> when calling create

Cause: this.create("<name>") resolves the name through the calling file’s own imports, and no value import in that file binds it. Check:
  • the calling file imports the class with a value import, not import type — compilation erases a type-only import, so there is nothing to resolve through
  • the name passed to create exactly matches the exported class name
  • or pass the class instead of its name: this.create(<name>)

Cannot access '<name>' before initialization

Cause: Two files import each other, and one of them uses the other’s class while that file is still loading — almost always a page object that extends a class declared in a file importing it back. Two page objects that import each other are fine; extending across that pair is not, because the file that loads second evaluates extends before the class exists. Check:
  • the base class lives in a file that imports neither of the two page objects
  • nothing else in the cycle runs at module top level against an imported binding — using it inside a method body is fine, since both files have finished loading by then

A page object’s popup or route hook never runs

Cause: The hook is not declared where initializeBrowser() reads it, or the flow let it through — see Entry points and page hooks. Check:
  • popupHandlers() / routeInterceptors() is declared as a static method on the entry point, not on another page object
  • the entry point’s create() launches the browser through initializeBrowser()
  • the flow does not pass the hook’s name in allowPopups / allowRoutes

this.create("X") returns BasePageObject instead of X

Cause: The name form has no way to know which class comes back, so its return type defaults to BasePageObject and X’s own methods are not visible. Check:
  • pass the class instead of its name: this.create(X)
  • or annotate the call: this.create<X>("X")
Last modified on October 6, 2026