You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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!
The text was updated successfully, but these errors were encountered:
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
require
s (orimport
s) 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:
When I write a bad
import
, I get into React Hot Loader'scatch
handler instead (which just prints the error), and something breaks, because subsequent hot reloads don't update the component.How do I get the behavior I want:
NoErrorsPlugin
import
, like withNoErrorsPlugin
?
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!
The text was updated successfully, but these errors were encountered: