-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] polyfill globally like all others #20963
Conversation
💔 Build Failed |
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.
👍
As @sqren mentioned in elastic#20914 (comment) we are using three different fetch polyfills, and it's not totally clear which one is winning out. For some time `import 'whatwg-fetch'` has been included globally in the browser for the last 6 months or so, but wasn't compatible with jest tests running in node.js, which seems to be the reason people have been reaching for `isomorphic-fetch`. Rather than relying on the version of `whatwg-fetch` and `node-fetch` that `isomorphic-fetch` depends on, we can just rely on them directly and stub out the global fetch for jest tests in a jest setup module.
💔 Build Failed |
Looks like |
Yeah, I tried looking into it but it's unclear why the tests were passing before but not now. thinking it might be because of how old the node-fetch inside isomorphic-fetch was... but haven't spent time to really look into it |
Hey @spalger , I'm removing review request from myself just to keep things on my Dashboard tidy, but feel free to request it once again if you still need one :) |
Might come back to this later. |
As @sqren mentioned in #20914 (comment) we are using three different fetch polyfills, and it's not totally clear which one is winning out. For some time
import 'whatwg-fetch'
has been included globally in the browser for the last 6 months or so, but wasn't compatible with jest tests running in node.js, which seems to be the reason people have been reaching forisomorphic-fetch
. Rather than relying on the version ofwhatwg-fetch
andnode-fetch
thatisomorphic-fetch
depends on, we can just rely on them directly and stub out the global fetch for jest tests in a jest setup module.