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

Is it possible to have Redbox output the error to console, so sourcemaps in Chrome can do their magic #77

Closed
damonmaria opened this issue Oct 16, 2016 · 5 comments

Comments

@damonmaria
Copy link

At the moment when I get a Redbox error I have no idea where it happened due to JS packaging and minification. However, this normally isn't a problem because Chrome uses sourcemaps to translate the stack trace and source code into something reasonable. But when Redbox fires there's no stack trace to the console, just in the Redbox. Would it be possible to output the stack to the console too?

@davidpfahler
Copy link
Member

@damonmaria Thanks for your request. It is possible to log the error to the console, but we would have to implement this feature. I think there should be a prop, e.g. <RedBox loggin="true">. I'm not sure if the default should be logging on or off.

@damonmaria Do you think you could send a pull request for this feature?

@damonmaria
Copy link
Author

If it was an option, and the default was no logging, then it wouldn't actually help my situation since I don't use redbox-react directly but have it forced upon me through the react-hot-loader package.

I can't think of why the logging would be annoying to someone when their entire page turning bright red wasn't already 😉

Would you be OK with a PR that had it on by default without an option to turn it off?

@davidpfahler
Copy link
Member

I think you can configure the error component in hot loader but we can default to logging anyways, so 👍

@damonmaria
Copy link
Author

@davidpfahler Just FYI I've moved away from using the package that had me using redbox, so there's not much motivation for a PR for me anymore.

@davidpfahler
Copy link
Member

@damonmaria Thanks for letting me know.

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

No branches or pull requests

2 participants