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

Advanced HMR Error Handling (1 of 2: Refactoring) #1072

Merged
merged 2 commits into from
Sep 18, 2020

Conversation

FredKSchott
Copy link
Owner

Changes

  • Adds support for a new "error" HMR event.
  • Cleans up how errors are reported in the builder so that they are bubbled up to the caller and not swallowed.
  • Sets the stage for the visual component ("hmr-error-overlay") without actually adding it in this PR. Right now, an error is propagated to the client as a console.error message in your dev tools, which is an improvement in its own right!

Testing

  • Dev is tested manually. Manually tested this on every template with:
    • load() error
    • transform() error
    • import error

@FredKSchott FredKSchott requested a review from a team as a code owner September 17, 2020 06:02
@vercel
Copy link

vercel bot commented Sep 17, 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/mwga437d4
✅ Preview: https://snowpack-git-wip-hmr-error-refactor.pikapkg.vercel.app

// note: for many plugins like Babel, `err.toString()` is needed to display full output
logger.error(err.toString() || err, {name: step.name});
if (isExitOnBuild) {
process.exit(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

// note: for many plugins like Babel, `err.toString()` is needed to display full output
logger.error(err.toString() || err, {name: step.name});
if (isExitOnBuild) {
process.exit(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

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

2 participants