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(webpack): notify CLI even if there are compilation errors #10141

Merged
merged 2 commits into from Mar 28, 2023

Conversation

rigor789
Copy link
Member

@rigor789 rigor789 commented Dec 21, 2022

PR Checklist

What is the current behavior?

When there's a compilation error, webpack may emit files (depending on how it's configured), however the CLI is never notified of these files, so they are not synced to the device. This is generally the right behavior however there are cases where this isn't ideal, most notably with HMR. When there's a compilation error, a new hash is assigned to the compilation, and files are written but never synced. After fixing the error, yet another hash is generated, however the app will not be able to apply hmr because it must first apply the "errored" hash, and then the fixed one - it works like a sequential chain, and if we don't emit the errored chain links, we break HMR.

What is the new behavior?

The CLI is notified regardless of errors in the compilation. This may crash the app - however that's expected in some cases. In other cases this should fix HMR breakage after a single error during development.

References:

@nx-cloud
Copy link

nx-cloud bot commented Dec 21, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 79487a6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@cla-bot cla-bot bot added the cla: yes label Dec 21, 2022
@ammarahm-ed
Copy link
Sponsor Contributor

I hope we can merge this & push a new webpack release. This breaks HMR quite often & i need to restart the CLI time & again.

@rigor789 rigor789 merged commit 6059984 into main Mar 28, 2023
2 checks passed
@rigor789 rigor789 deleted the fix/webpack-notify-cli-on-errors branch March 28, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants