Skip to content

Incorrect error stack #10

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
ivantsov opened this issue Sep 25, 2015 · 8 comments
Closed

Incorrect error stack #10

ivantsov opened this issue Sep 25, 2015 · 8 comments

Comments

@ivantsov
Copy link

When error occurs in render method, console.error(err) will be called and it will show wrong callstack:
wrong-stack

I think you should use console.error(err.stack) instead. It will produce correct call stack:
right-stack

@gaearon
Copy link
Owner

gaearon commented Sep 25, 2015

Woah. Wanna make a PR? Does this work in every browser and with different devtool configurations?

@ivantsov
Copy link
Author

Okay, I'll check it out in different environments and if my solution works - will make a PR.

@ivantsov
Copy link
Author

Hmm, I guess it was my fault... There is an '(...)':
wrong-stack
The right callstack will be shown when you click it:
right-stack

Maybe it's not obvious and you should show err.stack but it's up to you because I don't really know how many people are aware of this feature. Maybe I'm the only one who didn't know :)

@idolize
Copy link

idolize commented Oct 5, 2015

@shpuntik I was likewise very confused by this problem. I don't think the default stack shown is very helpful unless you are working to debug react-transform-catch-errors itself.

PR would still be worthwhile in my opinion.

@gaearon
Copy link
Owner

gaearon commented Oct 5, 2015

Happy to accept a PR fixing this.

@ivantsov
Copy link
Author

ivantsov commented Oct 6, 2015

Should be resolved in #12. Tested in chrome and firefox.

@gaearon
Copy link
Owner

gaearon commented Oct 6, 2015

Fixed by #12, will be out in next release.

@gaearon gaearon closed this as completed Oct 6, 2015
@mik01aj mik01aj mentioned this issue Dec 15, 2015
@gaearon
Copy link
Owner

gaearon commented Dec 25, 2015

Out in 1.0.1 implemented in a slightly different way so it's compatible with Firefox too.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants