Skip to content

Include a stacktrace from execjs #215

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

Merged
merged 3 commits into from
Mar 24, 2015
Merged

Include a stacktrace from execjs #215

merged 3 commits into from
Mar 24, 2015

Conversation

andygeers
Copy link
Contributor

The latest version of execjs now includes backtraces in Javascript errors - this makes debugging problems much easier!

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@vipulnsward
Copy link
Contributor

@andygeers tests are failing, could you take a look?
Also we support rubyracer, etc. Would this be affected by this?

@rmosolgo
Copy link
Member

Looks like the same failing test that's been bugging us all along:

  2) Error:
ViewHelperTest#test_react_server_rendering_does_not_include_internal_properties:
ActionView::Template::Error: TypeError: Cannot set property 'root' of null
  (in /home/travis/.rvm/gems/ruby-2.0.0-p598/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)

That lingering Turbolinks bug, tried to address here, #168 but locking to 1.8.0 gave people other problems.

@andygeers could you add a test that checks for the presence of a backtrace? That would give some insight to how it's treated on the different JS runtimes (and make sure this feature keeps working!)

@rmosolgo
Copy link
Member

Sorry, should have said first: thanks, this will be a great feature!! :D

@andygeers
Copy link
Contributor Author

@rmosolgo I'm not sure if that's the kind of test you were looking for?
@vipulnsward From what I can tell, the change in execjs applies to all the different runtime engines they support - we're using rubyracer here, and there are definitely commits related to fixing it in rhino too

@rmosolgo
Copy link
Member

Yeah, like that, but preferably without stubbing ExecJS::ProgramError#backtrace. While the stub is present, we wouldn't know if the ExecJS API changed.

I imagine it's hard (and pointless) to test the actual content of the backtrace, but I think it would be an improvement even just to test for a bunch of newlines, for example,

assert(err.message.count("\n") > 2, "The error has a multi-line backtrace")

That puts a nice regression test on getting what we expect from ExecJS!

@andygeers
Copy link
Contributor Author

Ok, done

@rmosolgo
Copy link
Member

👍 😻 it'll be great to actually get some context from the prerender environment!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@rmosolgo
Copy link
Member

thanks again!

rmosolgo pushed a commit that referenced this pull request Mar 24, 2015
Include a stacktrace from execjs
@rmosolgo rmosolgo merged commit 6f54184 into reactjs:master Mar 24, 2015
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

Successfully merging this pull request may close these issues.

4 participants