-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
new features of Node.js: native fetch #503
Comments
I also read about it. It would be nice to use native 🙂 I think we need to wait until it is available in an LTS version. |
Node 18 LTS started this week and https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch |
Nice 🤩 |
I notice that my tests that use |
Happy DOM has its own implementation of @tatemz do you have an example of when it fails? |
I was able to override it like this: import { GlobalRegistrator } from "@happy-dom/global-registrator";
const f = fetch;
GlobalRegistrator.register();
window.fetch = f; This fixed an issue for me with the implemented fetch shim:
The issue happens every time using bun test. It also happens for script tags with Bun JS and then this workaround doesn't work. See the same bug filed on their tracker: oven-sh/bun#8774 (Sorry for not debugging more. I'm already spending time I don't have trying to migrate my tests) |
node add the experimental fetch after v17.5.0, so maybe we can delete package dependency of
node-fetch
in the near future.Refer:
https://nodejs.org/en/blog/release/v17.5.0
The text was updated successfully, but these errors were encountered: