New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window can not be created in Bun from version 14.5.1 and higher #1415
Labels
bug
Something isn't working
Comments
Also reproductible on bun 1.1.4 in wsl2 |
I am also having the same problem but in my case I see two errors. I am using 26 | resolve();
27 | }
28 | else {
29 | this.readyStateCallbacks.push(resolve);
30 | if (this.totalTasks === 0 && !this.immediate) {
31 | this.immediate = this.window.requestAnimationFrame(this.endTask.bind(this));
^
TypeError: this.window.requestAnimationFrame is not a function. (In 'this.window.requestAnimationFrame(this.endTask.bind(this))', 'this.window.requestAnimationFrame' is undefined)
at PROJECT_ROOT\node_modules\happy-dom\lib\nodes\document\DocumentReadyStateManager.js:31:38
at new Promise (:1:21)
at waitUntilComplete (PROJECT_ROOT\node_modules\happy-dom\lib\nodes\document\DocumentReadyStateManager.js:24:16)
at new BrowserWindow (PROJECT_ROOT\node_modules\happy-dom\lib\window\BrowserWindow.js:554:9)
at new Window (PROJECT_ROOT\node_modules\happy-dom\lib\window\Window.js:36:9)
at createDocument (PROJECT_ROOT\src\document.ts:12:18)
at new UI (PROJECT_ROOT\src\index.ts:9:29)
at PROJECT_ROOT\test\index.tsx:6:12
184 | return false;
185 | }
186 | if (ancestorNode === referenceNode) {
187 | return true;
188 | }
189 | if (!ancestorNode[PropertySymbol.childNodes].length) {
^
TypeError: undefined is not an object (evaluating 'ancestorNode[PropertySymbol.childNodes].length')
at isInclusiveAncestor (PROJECT_ROOT\node_modules\happy-dom\lib\nodes\node\NodeUtility.js:189:14)
at appendChild (PROJECT_ROOT\node_modules\happy-dom\lib\nodes\node\NodeUtility.js:24:52)
at appendChild (PROJECT_ROOT\node_modules\happy-dom\lib\nodes\element\ElementUtility.js:52:13)
at insertNode (PROJECT_ROOT\src\document.ts:48:9)
at insertExpression (PROJECT_ROOT\node_modules\solid-js\universal\dist\universal.js:85:9)
at PROJECT_ROOT\node_modules\solid-js\universal\dist\universal.js:224:9
at createRoot (PROJECT_ROOT\node_modules\solid-js\dist\server.js:58:14)
at render (PROJECT_ROOT\node_modules\solid-js\universal\dist\universal.js:222:7)
at render (PROJECT_ROOT\src\index.ts:33:5)
at PROJECT_ROOT\test\index.tsx:18:16
Bun v1.1.8 (Windows x64) |
I think it's up to the Bun.js team to fix this, they seem to be aware:
Source: https://bun.sh/docs/runtime/nodejs-apis#node-vm Probably, this is the issue oven-sh/bun#4205. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using
new Window()
in a Bun environment, the script crashTo Reproduce
Steps to reproduce the behavior:
happy-dom
version 14.5.1 or highernew Window()
bun ./index.js
Expected behavior
The program should run correctly
Screenshots
If applicable, add screenshots to help explain your problem.
Device:
Additional context
The text was updated successfully, but these errors were encountered: