Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Error messages report meaningless line numbers #14

Open
aseemk opened this issue May 11, 2011 · 0 comments
Open

Error messages report meaningless line numbers #14

aseemk opened this issue May 11, 2011 · 0 comments
Milestone

Comments

@aseemk
Copy link

aseemk commented May 11, 2011

Here's a simple example of an input string that fails:

https://gist.github.com/966185#file_error.html

But the error I get from it is this:

Error: Parse error on line 10: Unexpected 'IDENTIFIER'
    at Object.parseError (/usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/parser.js:470:11)
    at Object.parse (/usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/parser.js:540:22)
    at Object.compile (/usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/coffee-script.js:26:22)
    at /usr/local/lib/node/.npm/eco/1.0.3/package/lib/eco/compiler.js:11:27
    at Object.render (/usr/local/lib/node/.npm/eco/1.0.3/package/lib/eco/compiler.js:19:39)
    at Object.<anonymous> (/Users/aseemk/Projects/Node/misc/app.coffee:10:33)
    at ServerResponse._render (/usr/local/lib/node/.npm/express/2.2.2/package/lib/view.js:377:21)
    at ServerResponse.render (/usr/local/lib/node/.npm/express/2.2.2/package/lib/view.js:242:17)
    at Object.<anonymous> (/Users/aseemk/Projects/Node/misc/app.coffee:19:18)
    at param (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/middleware/router.js:148:21)

But line 10 in the input is an empty line! After some investigating, line 10 is referring to the intermediate CoffeeScript that Eco generates:

https://gist.github.com/966185#file_generated.coffee

The problem is, that generated CoffeeScript isn't saved to a file or anything -- I had to manually add some console.logs() to Eco's compiler.js to see it.

The end result is that the line numbers reported in these error messages are pretty meaningless when you're looking at the source. It would be nice if they mapped to the source Eco template instead.

And for inspiration, the real goal to strive towards is the awesome reporting that Stylus has achieved:

http://tjholowaychuk.com/post/5002088731/stylus-vs-sass-vs-less-error-reporting

=)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant