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

Implement error overlay #764

Merged
merged 4 commits into from
Feb 3, 2017
Merged

Implement error overlay #764

merged 4 commits into from
Feb 3, 2017

Conversation

SpaceK33z
Copy link
Member

@SpaceK33z SpaceK33z commented Jan 28, 2017

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 while people were happy.

The error overlay is only enabled when you add the option overlay: true in your devServer 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

@SpaceK33z
Copy link
Member Author

SpaceK33z commented Jan 28, 2017

Anyone wants to test this? Info on how to test a PR.

@STRML
Copy link

STRML commented Feb 2, 2017

A few comments:

  1. overlay option works fine. 👍
  2. I'm not able to get the actual syntax error location from something like <div></span> - I just get the stack with Module build failed. Using HMR and devtool: "eval". Is there further setup required?

@Restuta
Copy link

Restuta commented Feb 3, 2017

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

@karl
Copy link

karl commented Feb 3, 2017

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!

@SpaceK33z
Copy link
Member Author

@STRML, I just tested this in a project of mine with React and JSX. It looks like this when I change a </div> to </span>:

screen shot 2017-02-03 at 11 38 26

It didn't need any extra configuration. This was with devtool: "eval". I haven't setup HMR though (don't have the time right now to test that out).

@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!

@Restuta
Copy link

Restuta commented Feb 9, 2017

@SpaceK33z I meant hot-middleware, sorry

@KutnerUri
Copy link

KutnerUri commented Feb 22, 2022

@SpaceK33z - is this still live? does it handle runtime errors?

I'm getting this different looking overlay
Screen Shot 2022-02-22 at 17 51 46

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.

5 participants