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

Any way to prevent webpackMissingModule on hot updates? #1105

Closed
gaearon opened this issue May 22, 2015 · 1 comment
Closed

Any way to prevent webpackMissingModule on hot updates? #1105

gaearon opened this issue May 22, 2015 · 1 comment

Comments

@gaearon
Copy link
Contributor

gaearon commented May 22, 2015

I'm sorry if I'm writing silly things :-)

I am a happy user of HMR but there's something that bugs me. I use hot/only-dev-server to prevent refreshes on compile errors. It works great!

Until recently, I also used NoErrorsPlugin, but as its name implies, it won't say anything if I make a syntax error in my JS that JSX compiler, or Babel, or whatever I'm using, doesn't understand. I will see the error in Terminal, but HMR will say that nothing was hot updated.

Today, I tried to remember why I used NoErrorsPlugin, and I couldn't, so I turned it off. I finally started to see compile errors in the browser console, and after fixing them, hot reload still worked! This is exactly what I wanted.

However there is one sort of errors that I couldn't recover from: the requires (or imports) with bad filenames. (I often mistype things.)

When I get a "simple" syntax error, I see this, and the next reload works fine after I fix it:

screen shot 2015-05-23 at 2 36 05

When I write a bad import, I get into React Hot Loader's catch handler instead (which just prints the error), and something breaks, because subsequent hot reloads don't update the component.

screen shot 2015-05-23 at 2 37 27

How do I get the behavior I want:

  • Print errors to console like without NoErrorsPlugin
  • Don't stop hot reloading after mistyping an import, like with NoErrorsPlugin

?

Maybe I should fix something in React Hot Loader? Write a custom plugin? Maybe something can be changed on Webpack side?

Thanks for considering this!

@gaearon
Copy link
Contributor Author

gaearon commented Aug 28, 2015

I think my need for NoErrorsPlugin was due to React Hot Loader's wrong usage of HMR API, which I have fixed in 1.3.0.

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

No branches or pull requests

1 participant