-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement error overlay #764
Conversation
Anyone wants to test this? Info on how to test a PR. |
A few comments:
|
I am not using "webpack-dev-server" directly, I am using "webpack-dev-middleware", is there a way to have it as part of the middleware itself? @SpaceK33z |
Just tested this in our codebase at work and it behaved correctly as far as I could see. We would find this really useful for making it clear when compilation had failed. We'd definitely use this if it was merged in! |
@STRML, I just tested this in a project of mine with React and JSX. It looks like this when I change a It didn't need any extra configuration. This was with @Restuta, no, webpack-dev-middleware can't communicate to the webpage since it's only middleware. webpack-hot-middleware does offer this functionality btw. @karl, thanks for testing! |
@SpaceK33z I meant hot-middleware, sorry |
@SpaceK33z - is this still live? does it handle runtime errors? |
What kind of change does this PR introduce?
Feature
Did you add or update the
examples/
?Yes
Summary
This adds an error overlay in the browser, like create-react-app has. It works very much like create-react-app's error overlay. In fact, I copied much code from it 😅 .
I asked on Twitter if people would like this feature, and
everyone forgot Trump for a whilepeople were happy.The error overlay is only enabled when you add the option
overlay: true
in yourdevServer
config. It could be enabled by default, but that would kinda be a breaking change so maybe in v3.Furthermore, it will only show errors, not warnings. I'm not sure yet if we should display warnings the same way. If we would do that, there also needs to be a way to disable it.
Does this PR introduce a breaking change?
Nope