-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby): fix hot-reloading for hooks (patch hmr) #13713
Conversation
I'll also create a PR on react-hot-reloader, might not get accepted but than we can remove our monkey patch in a next version of gatsby. |
Hey @wardpeet - I'd love to test this on a project that's giving me trouble. How can I reference your PR in package.json to pull in this specific version of gatsby? |
it's not that easy, you'll need to follow https://www.gatsbyjs.org/blog/2018-04-11-trying-out-gatsby-at-work-and-co/#branching-off which might give you insights on how to. |
@@ -1,3 +1,8 @@ | |||
// isomorphic-fetch sets global.fetch which seems to conflicts with source-map@<0.8.0 where it does a |
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.
🤦♂
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.
Thank you as always @wardpeet 🥇
Published in |
Should fix hot-reloading issues for new react features (hooks) and also fix the issue with
You must provide the URL of lib/mappings.wasm
. A few packages use isomorphic-fetch which polyfills global.fetch.The source-map package doesn't deal with pollyfilled versions so it will go for the web version instead of trying to load wasm with nodejs. (https://github.com/mozilla/source-map/blob/0.7.3/lib/read-wasm.js#L1). It's fixed in 0.8.0-beta but it hasn't been released for a while so for now I manually monkey patch the hmr package.
// error:
You can test this PR on gatsby-www or create a new starter and include isomorphic-fetch inside gatsby-config.js
References:
#13610 (comment)
#13641