-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Show javascript errors in overlay #582
Comments
For those who aren't familiar, redbox-react is usually used to do this. Looks like the |
Re: |
PR adding this to another project react-cosmos/react-cosmos#484 |
If anyone takes this on don't hesitate to ask me questions, I could also give it a stab if someone points me in the right direction (where it'd need wired into). |
Oh sweet! Thanks for hopping in and offering to help! Would love to get this in soon. First question though is does the overlay work with webpack 1 still? That's where we are still unfortunately. This is the entry file for development https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/root.js |
Depends on what angle you're asking that question -- our webpack middleware might work with webpack 1, but we know it works on webpack 3. As for the overlay itself (just importing): currently, no -- we only ship an ESM version of the overlay (you could put it through babel). The overlay itself does not depend on anything webpack, its a completely separate package with 0 dependencies -- we just have to decide on the integration points. |
What does the integration point need to be? Where in the app is it? |
The overlay simply needs to be required in the applications source, preferably as an entry point. The "integration" points I was speaking of pertain to the click-to-open source / build errors; you can use our webpack development server or add the necessary hooks to enable those features in your server (none of which are necessary for the overlay to work). |
Oh sweet — sounds fairly straightforward then. Would love a PR adding the overlay to https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/root.js We use webpack-dev-middleware — is the click-to-open / build errors compatible with that?
|
This is shipped! Thanks again @Timer! |
create-react-app and next.js have this and it's super cool and useful. You know right away when something is wrong instead of having to keep glancing at your terminal or browser console.
Also next.js adds syntax highlighting to the error which is nifty.
vercel/next.js#195
The text was updated successfully, but these errors were encountered: