Closed al6x closed 11 years ago
It shouldn't crash (and doesn't for me). The correct behavior is to serve a 500 server error for the file, and log the actual error message to the console. How are you using it, and what output are you getting?
Ah, it does now. It should be fixed by https://github.com/substack/node-browserify/pull/375 which leads to really nice syntax errors like:
C:\GitHub\browserify-middleware\example\client\syntax-error.js:1
foo(
^
ParseError: Unexpected end of input
Thanks for your help and sorry for delay with providing details about the problem. I use node for my free-time projects and usually can work with it in on weekends only :).
No worries, thanks for the initial report. Hopefully the fix will get merged soon. If not, it can be worked around.
This is fixed in 1.7.1 I'd like to leave this issue open as a reminder to remove the hack once @substack merges the proper fix.
I'm still patching https://github.com/substack/node-syntax-error/pull/1 but https://github.com/substack/node-browserify/issues/375 is now merged so I'm closing this issue.
If there's an error in transformer (in my case coffeeify) it still crashes, and, what's worse there's no information about the problem - so it's very hard to locate problem, more details https://github.com/substack/coffeeify/pull/10
Currently if there's syntax error in file node.js will crash with error messages in console.
Maybe it would be better (at least in development) to show error messages in console and in http request for js file, but not crash the server.