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

Cryptic error on template parse error - not enough details provided to properly track down the issue #35

Open
arimus opened this issue Nov 9, 2016 · 3 comments

Comments

@arimus
Copy link

arimus commented Nov 9, 2016

I got the following error which was less than simple to track down. I had to comment out blocks at a time in a template that was being parsed in Angular2 until I narrowed it down. It turned out to be that in my template I had:

${{removeContribution.amount}}

instead of

{{removeContribution.amount}}

A typo on my part, however it'd be great to die with a more sensical error that perhaps even pointed out the where. I had to modify the source code to dump the file it was parsing, so I could determine which template it was dying on...then proceed to figure out why.

/Users/arimus/workspace/project/node_modules/gulp-template/node_modules/lodash/lodash.js:487
case 0: return func.call(thisArg);
^
SyntaxError: Unexpected token .
at /Users/arimus/workspace/project/node_modules/gulp-template/node_modules/lodash/lodash.js:14776:16
at apply (/Users/arimus/workspace/project/node_modules/gulp-template/node_modules/lodash/lodash.js:487:27)
at /Users/arimus/workspace/project/node_modules/gulp-template/node_modules/lodash/lodash.js:15160:16
at apply (/Users/arimus/workspace/project/node_modules/gulp-template/node_modules/lodash/lodash.js:489:27)
at /Users/arimus/workspace/project/node_modules/gulp-template/node_modules/lodash/lodash.js:6558:16
at template (/Users/arimus/workspace/project/node_modules/gulp-template/node_modules/lodash/lodash.js:14775:20)
at DestroyableTransform._transform (/Users/arimus/workspace/project/node_modules/gulp-template/index.js:21:14)
at DestroyableTransform.Transform._read (/Users/arimus/workspace/project/node_modules/readable-stream/lib/_stream_transform.js:159:10)
at DestroyableTransform.Readable.read (/Users/arimus/workspace/project/node_modules/readable-stream/lib/_stream_readable.js:357:10)
at flow (/Users/arimus/workspace/project/node_modules/readable-stream/lib/_stream_readable.js:727:26)

@sindresorhus
Copy link
Owner

Pull request welcome :)

@Flood
Copy link

Flood commented May 8, 2017

Any updates on this?

We are experiencing the same problem using angular-seed here mgechev/angular-seed#1498 and here mgechev/angular-seed#1892

@drosi94
Copy link

drosi94 commented May 16, 2017

Same issue here

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

No branches or pull requests

4 participants