-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
Add error overlay like create-react-app's #284
Comments
Hey @jaredpalmer! +import razzleHMRProxy from 'razzle-dev-utils/razzleHMRProxy';
export default express()
+ .use((req, res) => razzleHMRProxy(req, res))
.use((req, res) => app.handle(req, res))
.listen(port, function (err) { |
Or furthermore, perhaps even ditch the webpack dev server entirely and migrate it to the webpack middleware? (swapping out the proxy in above example for a webpack middleware that razzle could export) |
That would be cool. |
What was the reasoning behind running the dev server on a seperate port in the first place instead of using the middleware, if I may ask? |
@jaredpalmer 🎉 |
Does this display serverside errors too? |
Don't think so. It works by creating a socket from webpack-dev-server and your client bundle. |
I am working with Dan to fix a bug that is preventing runtime errors from showing up. Right now only compiler / lint errors show |
how about using componentDidCatch now that it exists? sorry if this has been discussed elsewhere before. |
AFAIK componentDidCatch can’t be used with SSR |
Create-react-app uses a custom webpack dev server client and its own custom error overlay. We could use switch to react-dev-utils/webpackHotDevClient.js, except that it uses
window.location.port
. From my initial explorations, this was the dealbreaker.That being said, it would be really nice to get an error overlay like CRA's for Razzle
The text was updated successfully, but these errors were encountered: