Skip to content
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 fast-refresh plugin #710

Merged
merged 2 commits into from Aug 4, 2020
Merged

Fix fast-refresh plugin #710

merged 2 commits into from Aug 4, 2020

Conversation

mdlawson
Copy link
Contributor

@mdlawson mdlawson commented Aug 1, 2020

Changes

It looks like #659 missed pulling the filePath value out of the transform arguments, which leads to all files processed by this plugin failing to build. This change fixes that, and adds some additional logging to make similar issues more obvious to debug in the future.

Testing

The current issue can be reproduced pretty easily in a fresh snowpack react app by just installing @snowpack/plugin-react-refresh and adding it to the plugins array, then running npm start. The app that opens will be blank, and the devtools network panel shows a 500 loading /_dist_/App.js. After making this change to the plugin, the app will load & fast refresh appears to work correctly.

It looks like FredKSchott#659 missed pulling the `filePath` value out of the transform arguments, which leads to all files processed by this plugin failing to build.
Currently errors which occur while building a file are silently swallowed within the dev server, which makes them slightly harder to track down.
@mdlawson mdlawson requested a review from a team as a code owner August 1, 2020 16:55
@vercel
Copy link

vercel bot commented Aug 1, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/i7ru8pu14
✅ Preview: https://snowpack-git-fork-mdlawson-patch-1.pikapkg.vercel.app

@FredKSchott
Copy link
Owner

Thanks! We have trouble testing dev-only plugins and missed this one, will get out the update asap

@FredKSchott FredKSchott merged commit 9f6eb19 into FredKSchott:master Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants