node-blade icon indicating copy to clipboard operation
node-blade copied to clipboard

Better Reporting for Syntax Errors

Open bminer opened this issue 13 years ago • 11 comments

If there is a problem with the Blade compiler, or more likely, if there is a syntax error with the JavaScript code in a template, Node.js will not provide any line number or other information about the error. At the time of this writing, this is a limitation of the Google V8 engine; it cannot report line numbers in evaled JavaScript code.

Related upstream issues:

Node: https://github.com/joyent/node/issues/229, https://github.com/joyent/node/issues/2734 Google V8: http://code.google.com/p/v8/issues/detail?id=1914 (now somewhat fixed) https://code.google.com/p/v8/issues/detail?id=1281 https://code.google.com/p/v8/issues/detail?id=2589

Progress is being made to improve this.

bminer avatar Jun 15 '12 13:06 bminer

Update: Google V8 now provides more detailed error information for evaled JavaScript code. Hopefully, this capability will be added to Node shortly...

Google V8 3.12.0 fixes issue 1914.

bminer avatar Jun 21 '12 02:06 bminer

Update: This feature will probably not be added to Node v0.8; it will likely appear in Node v0.9.

bminer avatar Jun 28 '12 02:06 bminer

~~Update: This feature will likely be added in the Node v0.9.3 release. It has been added to the node master branch.~~ Correction: This issue has not yet been fully resolved in Google V8

bminer avatar Oct 02 '12 18:10 bminer

i installed node 0.9.3 and Google V8 is 3.13.7.4, but this issus still exists

lenzhang avatar Nov 25 '12 12:11 lenzhang

@lenzhang - That's probably true. I have not yet tested on Node v0.9.x. Will keep you posted.

bminer avatar Nov 27 '12 21:11 bminer

@lenzhang - As it turns out, Google V8 3.12 revealed line and column numbers for runtime errors, not for compilation/parsing errors. I will continue to work with the V8 crew to come up with a solution. The relevant V8 issue is posted above.

bminer avatar Dec 06 '12 13:12 bminer

This is incredibly annoying. Is there any pressure put on this, some issue to star or something? The issue linked above seems to be marked as "fixed" when this is still an issue. I'm wasting copious amounts of time hunting down missing "{" in my code because it cannot provide proper line numbers.

mpj avatar Mar 02 '13 12:03 mpj

Sorry... it's still a V8 issue. I don't have much control over it. :( You can feel free to bug the V8 guys, though. Once it's fixed in V8, it will probably be fixed in Blade within a few months...

bminer avatar Mar 04 '13 20:03 bminer

Yeah, I get that, but is there an open issue reported on it? On V8, I mean? If there isn't, there is unlikely to be any movement. The V8 issue linked above is marked as fixed. :(

mpj avatar Mar 07 '13 14:03 mpj

@mpj - lol. Good point. Would you mind creating a separate issue (if it doesn't already exist) and link to it here?

bminer avatar Mar 07 '13 16:03 bminer

Update: Google V8 issues that address this problem:

~~- https://code.google.com/p/v8/issues/detail?id=1281~~

  • https://code.google.com/p/v8/issues/detail?id=2589

bminer avatar May 14 '13 20:05 bminer