playwright: [BUG:Webkit] `page.goto() / page.waitForLoadState()` method does not wait for the `load` event

Context:

  • Playwright Version: 1.14.0
  • Operating System: Ubuntu 18
  • Node.js version: v12.22.5

Bug appears only with Webkit launcher.

Steps to reproduce (reduced to a bare minimum):

  1. Clone this repo: git clone https://github.com/canonic-epicure/playwright-8340-repro
  2. In the checkout directory, run npm install
  3. In console, run npx exec wds. This will launch the dev web server on port 8000 (should be free, port is hardcoded)
  4. Now, run the node server.js in the separate shell.
  5. Observe the TypeError: window.CLIENT is not a function exception
  6. Uncomment this line in server.js: await page.waitForFunction(() => document.readyState === 'complete') This line performs a “manual” waiting for the load event
  7. Run node server.js again and observe the exception is gone.
  8. Comment that line back and make sure the exception appears again
  9. Comment these lines in client.js:
import { it } from 'https://cdn.jsdelivr.net/npm/@bryntum/siesta@latest/index.js'
it('', () => {})
  1. Observe the exception disappears (probably, since its a race condition).

The rootcause of the issue seems to be that client.js is importing some other big external module.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 20 (10 by maintainers)

Most upvoted comments

@unlikelyzero This is a different issues, specific to WebKit and async modules. #14897 fixes a race condition in Playwright code.