-
Notifications
You must be signed in to change notification settings - Fork 128
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
use native fetch for Next.js #286
Comments
Hi, dear @nainemom thanks for opening the issue. Is it possible for you to make a reproduction so i can better understand the issue? 🙏🏼 BTW if you want to explicitly use |
The fetch('https://...', {
method: 'GET',
next: {
tags: ['x'],
revalidate: 5000,
},
}); So if i use The actual issue of mine is that i want to get ride of |
Found these:
Neither The code in Please keep me informed if you found out more. A reproduction would be nice so i can check faster but will try to come back to this later. |
Response from the React team about patching: facebook/react#25573 (comment) |
Thanks for the ref @tom-sherman (one less thing to worry, i hope!) ❤️ |
I was debugging something completely different and found that Next.js saves the original |
It does indeed and people can do it in their project to depolyfill next at least for ofetch. However i am not comfortable adding such patch to the core, we might at least document it! ofetch.create({ fetch: globalThis._nextOriginalFetch || globalThis.fetch }); |
This seems out of our hands to do anything. If you feel it is something worth to fix, feel free to make an issue in next.js repository to track. |
Describe the feature
Hi, as you mentioned in readme, in nodejs environment this library uses native fetch if
globalThis.fetch
available and fallback it tonode-fetch-native
if its not supported. My problem is that i want to usenode-fetch-native
, even if nodejs version is higher than 18 andglobalThis.fetch
is available.The
nextjs
backend also doing some kind of your way to fillglobalThis.fetch
, the problem is that it does the job before theofetch
imports. so even if theglobalThis.fetch
is not available,nextjs
fill it with its own backend andofetch
cannot detect that native fetch is not supported.Additional information
The text was updated successfully, but these errors were encountered: