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

Custom syntax error / HMR error page #4813

Closed
vjpr opened this issue Jul 20, 2018 · 2 comments · Fixed by #4979
Closed

Custom syntax error / HMR error page #4813

vjpr opened this issue Jul 20, 2018 · 2 comments · Fixed by #4979

Comments

@vjpr
Copy link

vjpr commented Jul 20, 2018

Feature request

I would like to modify the error page for syntax errors.

lib/error-debug I believe.

My idea is to linkify the stack trace so I can open it in my IDE.

I do not see a way of doing it at preset.

@vjpr
Copy link
Author

vjpr commented Jul 20, 2018

Looks like it would be a simple addition:

client/index.js

  ErrorDebugComponent = passedDebugComponent
  ErrorComponent = await pageLoader.loadPage('/_error')

to

  ErrorDebugComponent = await pageLoader.loadPage('/_error-debug')
  ErrorComponent = await pageLoader.loadPage('/_error')

Actually there are a million other places that _error.js is hard-coded. I went and added a matching _error-debug to all of them and it works!


Maybe an alternative would be to pass a prop to _error.js which would tell it to render debug message...

@timneutkens
Copy link
Member

Linking to source code will be trivial to add after #4639 lands, as errors get rendered by react-error-overlay which has this feature built in.

timneutkens pushed a commit that referenced this issue Aug 24, 2018
This PR adds links to the [react-error-overlay](https://www.npmjs.com/package/react-error-overlay).
This allows a developer to open a stack trace in its own editor.

![codelinking](https://user-images.githubusercontent.com/1265681/44278860-a63e0a80-a24f-11e8-9c69-c5365c026c58.gif)

Closes #4813
@lock lock bot locked as resolved and limited conversation to collaborators Aug 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants