Context:
- Playwright Version: 1.14.
- Operating System: Linux
- Node.js version: 12.22.6
- Browser: Chromium
I found a very specific and a very bad bug, it is possibly related to the #8340 (see the note about setTimeout though). The iframe, created on the page, is never loaded (remains blank and doesn't fire the 'load' event), if the page is importing some big external module
Steps to reproduce:
- Clone this repo:
git clone git@github.com:canonic-epicure/playwright-9029-repro.git
- In the checkout directory, run
npm install
- In console, run
npx exec wds. This will launch the dev web server on port 8000 (should be free, port is hardcoded)
- Now, run the
node server.js in the separate shell.
- Observe the page opens and creates an iframe, which remains empty and its
load event is never triggered (console remains empty)
- Now, comment this line in
client.js:
import { it } from 'https://cdn.jsdelivr.net/npm/@bryntum/siesta@latest/index.js'
- Run
node server.js again and observe the iframe content is now visible and FRAME LOADED text appears in console.
And now the strange part:
- Uncomment the
setTimeout(() => { wrapper in client.js and observe the original bug returned, but only if delay time is relatively big (1-2s). If time is small (10ms or so) bug does not appear.
Additional info:
- The issue seems to be sporadic, sometimes the iframe does not load even w/o importing the external module
- If you'll change the
src attribute of the "stalled" iframe in web inspector, to lets say "https://playwright.dev", it remains stalled. The same happens for any other url, until you change the url to some website with X-Frame-Options set to prohibitive value (like "https://google.com"). After that, if you change the url to https://playwright.dev again, iframe will load normally.
- If you'll be using
document.createElement('iframe') to create an iframe, the issue will appear more often, event w/o importing big module.
Context:
I found a very specific and a very bad bug, it is possibly related to the #8340 (see the note about
setTimeoutthough). The iframe, created on the page, is never loaded (remains blank and doesn't fire the 'load' event), if the page is importing some big external moduleSteps to reproduce:
git clone git@github.com:canonic-epicure/playwright-9029-repro.gitnpm installnpx exec wds. This will launch the dev web server on port 8000 (should be free, port is hardcoded)node server.jsin the separate shell.loadevent is never triggered (console remains empty)client.js:node server.jsagain and observe the iframe content is now visible andFRAME LOADEDtext appears in console.And now the strange part:
setTimeout(() => {wrapper inclient.jsand observe the original bug returned, but only if delay time is relatively big (1-2s). If time is small (10ms or so) bug does not appear.Additional info:
srcattribute of the "stalled" iframe in web inspector, to lets say "https://playwright.dev", it remains stalled. The same happens for any other url, until you change the url to some website withX-Frame-Optionsset to prohibitive value (like "https://google.com"). After that, if you change the url tohttps://playwright.devagain, iframe will load normally.document.createElement('iframe')to create an iframe, the issue will appear more often, event w/o importing big module.