-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fetch() doesn't return correct Response type #4395
Comments
Hi @christian-reichart, where are you importing |
Hi @machour , I don't import it specifically, so it's the global fetch. |
Any reason why you're not using remix's fetch? import { fetch } from "@remix-run/node"; |
Thanks for your response @machour ! Correct me if I'm wrong but I was under the impression that Remix is supposed to let you use fetch and Response without any import. https://remix.run/docs/en/v1/other-api/fetch Is the documentation outdated? |
Now I'm the one confused 😅 I'll circle back with the team on this point and let you know what's the right approach, and will update the docs if necessary. In the meantime, does using You might also be interested in reading the "Moving closer to The Platform™" part from the 1.5.0 release notes : https://github.com/remix-run/remix/releases/tag/v1.5.0 |
@machour I have run into this issue with reimix-run/node and external libraries that use globals and instanceof Response. I have been able to work around but latest is in a nested dependency using oauth4webapi Any thoughts from the team yet on how to fix the inconsistent globals? In the router they worked around it as well for more context Although if it is an issue with esm vs cjs not sure what the solution could be |
Found fix and made a merge request. Here is patch that can be used with patch-package https://gist.github.com/acoreyj/37eff1fdc459dbea31515d5d40be7b35 |
Should be closed by #7109 |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
1.7.2
Steps to Reproduce
Inside the remix project try
This probably has to do with this commit:
25b4c83#diff-87ec1c3c130fe3481b9f1c542b1d8a53548882d33c73c68b894fd442d606afc0
A current workaround I found thanks to @milamer is to include
in the file.
Expected Behavior
instanceof Response should be true
Actual Behavior
instanceof Response is false
The text was updated successfully, but these errors were encountered: