Skip to content
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

Open
Dyskal opened this issue Apr 24, 2024 · 1 comment
Open

Window can not be created in Bun from version 14.5.1 and higher #1415

Dyskal opened this issue Apr 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Dyskal
Copy link

Dyskal commented Apr 24, 2024

Describe the bug
When using new Window() in a Bun environment, the script crash

To Reproduce
Steps to reproduce the behavior:

  1. Install happy-dom version 14.5.1 or higher
  2. Import Window and run new Window()
  3. Run the script with bun bun ./index.js
  4. See error

Expected behavior
The program should run correctly

Screenshots
If applicable, add screenshots to help explain your problem.

Device:

  • OS: Windows 11
  • Bun version: 1.1.4
  • Version: 14.5.1 to latest

Additional context

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:545:9)
      at new Window (${PROJECT_ROOT}\node_modules\happy-dom\lib\window\Window.js:36:9)
@Dyskal Dyskal added the bug Something isn't working label Apr 24, 2024
@Dyskal
Copy link
Author

Dyskal commented Apr 24, 2024

Also reproductible on bun 1.1.4 in wsl2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant