You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our unit tests, testing an iframe with YouTube embed, we suddenly started getting the following error, without obvious changes to the test code/code being tested:
TypeError: Cannot read properties of null (reading 'Symbol(asyncTaskManager)')
at Response.text (file:///agent/_work/1/s/.yarn/cache/happy-dom-npm-15.11.1-f040f1386c-10c0.zip/node_modules/happy-dom/src/fetch/Response.ts:206:40)
at Function.navigate (file:///agent/_work/1/s/.yarn/cache/happy-dom-npm-15.11.1-f040f1386c-10c0.zip/node_modules/happy-dom/src/browser/utilities/BrowserFrameNavigator.ts:222:34)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
While the version of happy-dom we're using is out of date, it looks like the lines in question remained unchanged since:
The reason is most likely due to browser frame not being available during tear down of the Window. It is hard to cover all cases for this as the Javascript often continues to run and can't be interrupted while the window is closing down.
I have added null checks for this case in Response now in v16.4.3
Describe the bug
In our unit tests, testing an iframe with YouTube embed, we suddenly started getting the following error, without obvious changes to the test code/code being tested:
While the version of happy-dom we're using is out of date, it looks like the lines in question remained unchanged since:
happy-dom/packages/happy-dom/src/fetch/Response.ts
Lines 205 to 206 in 3a79654
If we look at the code, it becomes apparent that indeed,
browserFrame
can benull
:happy-dom/packages/happy-dom/src/window/WindowBrowserContext.ts
Line 70 in 3a79654
For some reason null check isn't there and TypeScript does not complain.
To Reproduce
I'm so sorry, no reproducible example just yet, as I can only reproduce that on CI. Working on it, but maaaaybe the details provided will be enough?
Expected behavior
No crash
Device:
The text was updated successfully, but these errors were encountered: