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

JSON.parse stack traces break when using register #354

Open
jkrems opened this issue Oct 8, 2015 · 1 comment
Open

JSON.parse stack traces break when using register #354

jkrems opened this issue Oct 8, 2015 · 1 comment

Comments

@jkrems
Copy link

jkrems commented Oct 8, 2015

Minimal reproduction (using node 4):

rm -rf /tmp/missing-stack-trace; mkdir $_; cd $_ 
npm install coffee-script-redux coffee-script
echo 'JSON.parse("")' >b.coffee; echo 'require("./b.coffee")' >a.js

With redux:

> node -r coffee-script-redux/register a
undefined:1



SyntaxError: Unexpected end of input

With coffee-script:

> node -r coffee-script/register a 
undefined:1



SyntaxError: Unexpected end of input
  at Object.parse (native)
  at Object.<anonymous> (/private/tmp/missing-stack-trace/b.coffee:1:6)
  at Object.<anonymous> (/private/tmp/missing-stack-trace/b.coffee:1:1)
  at Module._compile (module.js:434:26)
  at Object.loadFile (/private/tmp/missing-stack-trace/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
  at Module.load (/private/tmp/missing-stack-trace/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/private/tmp/missing-stack-trace/a.js:1:63)
  at Module._compile (module.js:434:26)
  at Object.Module._extensions..js (module.js:452:10)
  at Module.load (/private/tmp/missing-stack-trace/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Function.Module.runMain (module.js:475:10)
  at startup (node.js:118:18)
  at node.js:952:3

The stack traces for JSON.parse disappear everywhere (and won't come, even in the following event loop ticks) the moment the first coffee-script file is required using -redux.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27264424-json-parse-stack-traces-break-when-using-register?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).
@michaelficarra
Copy link
Owner

Is this just in recent versions of node? Have you tested whether 0.12 is affected? Do other stack traces work properly? Have you caught the error and inspected the stack yourself instead of allowing node to print it?

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