-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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] FormData feature support detection broken #2376
Comments
Same issue with that, |
I'm having this same issue. You are right about self.fetch being the issue |
I am having the same issue, @oblador 's fix solved the problem. |
This would be a great fix to merge |
👍 definitely, at the moment I need to use template strings for the body. One thing to consider is that fetch is pulled in from github/fetch, meaning if it's updated in the future, all changes local to this repo are lost and would have to be reapplied. Probably better to include it there, though they seem reluctant to include it. On the other hand, maybe fetch was only initially imported and is now maintained by the react-native team. |
I'm having the same issue as well. @oblador's fix also worked for me. |
Summary: This PR bumps fetch to 0.9.0, the latest release and fixes broken feature detection originating in that self is not referring to `window.self` but an empty object. Assigning that object to window.self or GLOBAL won't work in the chrome dev tools because of CORS restrictions. This is a pragmatic solution but maybe not ideal. Background to the problem can be read here: #2376 Closes #2587 Reviewed By: @trunkagent, @svcscm Differential Revision: D2438341 Pulled By: @vjeux
My PR was recently merged, so I'm closing this issue. |
Summary: This PR bumps fetch to 0.9.0, the latest release and fixes broken feature detection originating in that self is not referring to `window.self` but an empty object. Assigning that object to window.self or GLOBAL won't work in the chrome dev tools because of CORS restrictions. This is a pragmatic solution but maybe not ideal. Background to the problem can be read here: facebook#2376 Closes facebook#2587 Reviewed By: @trunkagent, @svcscm Differential Revision: D2438341 Pulled By: @vjeux
I'm trying to post multipart files with
fetch
in RN 0.9.0 with something similar to this:It fails because the FormData feature detection always fails, more specifically
'FormData' in self
on line 165 @ fetch.js. If I changeself
towindow
it works as expected, but somehow that feels too easy. I'm happy to send a PR or for someone to tell me why it's a bad idea.The text was updated successfully, but these errors were encountered: