-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(happy-dom): support fetch globals #8791
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
fix(happy-dom): support fetch globals #8791
Conversation
| 'Headers', | ||
| 'AbortController', | ||
| 'AbortSignal', | ||
| 'URL', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sheremet-va After upgrading to vitest 4.0.3 my happy-dom-based tests are now failing with:
ReferenceError: URL is not defined
❯ new Location ../../node_modules/.pnpm/[email protected]/node_modules/happy-dom/lib/location/Location.js:26:25
❯ new BrowserWindow ../../node_modules/.pnpm/[email protected]/node_modules/happy-dom/lib/window/BrowserWindow.js:708:41
❯ new Window ../../node_modules/.pnpm/[email protected]/node_modules/happy-dom/lib/window/Window.js:39:9
❯ new GlobalWindow ../../node_modules/.pnpm/[email protected]/node_modules/happy-dom/lib/window/GlobalWindow.js:10:16
❯ Object.setup ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/index.DON9WL-E.js:338:69
❯ processTicksAndRejections node:internal/process/task_queues:105:5
❯ withEnv ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/base.RFExFinv.js:55:14
❯ run ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/base.RFExFinv.js:72:144
❯ runBaseTests ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/base.RFExFinv.js:122:2
❯ executeTests ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/init-forks.WSf5dRNP.js:24:4
Could it be related to this change? Downgrading to vitest 4.0.2 makes the issue go away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same failure for me ☝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, create an issue with a reproduction. A quick run of our happy-dom tests didn't show an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok done here #8882 👍
Description
Fixes #8777
Fixes #8788
We removed fetch related globals from the KEYS to support jsdom, but happy-dom does define them properly, so they need to stay in the happy-dom environment.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.