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

parseAggregate error address? #1087

Closed
Spown opened this issue Mar 18, 2018 · 8 comments · May be fixed by dubscratch/MagicMirror#16
Closed

parseAggregate error address? #1087

Spown opened this issue Mar 18, 2018 · 8 comments · May be fixed by dubscratch/MagicMirror#16

Comments

@Spown
Copy link

Spown commented Mar 18, 2018

@3.1.2

So I have made an error somewhere, but the error doesn't tell me where. This is all I get.

{
  message: "parseAggregate: expected comma after expression",
  name: "Template render error",
  stack: "Template render error: parseAggregate: expected comma after expression\
    at Object._prettifyError ([...]\node_modules\nunjucks\src\lib.js:35:11)\
    ..."
}

I can find it manually, no problem, but it would be much easier if knew at least roughly where...

Thank you.

@ArmorDarks
Copy link

Do you render your template with env.render or env.renderString?

@Spown
Copy link
Author

Spown commented Mar 18, 2018

env.render(path, ctx). And I tried both sync and async versions.

@ArmorDarks
Copy link

Can you show full stack?

The message is quite strange because if an error would happen during rendering, it has to contain line numbers and source. But in your case, it looks like a typo in your code, which happens before rendering even can begin.

@Spown
Copy link
Author

Spown commented Mar 18, 2018

I've already found it - it was {{t('some_key'', var)}} i.e. an extraneous quote mark. So you say, I don't get template address on syntax errors?

@ArmorDarks
Copy link

I'm not sure what you're doing differently, but you should get an address.

For some reason, you even get a different error.

For instance, with your example I'm receiving following error:

>> Template render error: (J:\Work\soma-app\source\templates\index.nj) [Line 17, Column 19]
>>   parseSignature: expected comma after expression

Note that it is Template render error, not parseAggregate error

@Spown
Copy link
Author

Spown commented Mar 18, 2018

Full stack:

 Template render error: parseAggregate: expected comma after expression
       at Object._prettifyError ([prj_root]\node_modules\nunjucks\src\lib.js:35:11)
       at Template.render ([prj_root]\node_modules\nunjucks\src\environment.js:526:21)
       at [prj_root]\node_modules\nunjucks\src\environment.js:350:27
       at createTemplate ([prj_root]\node_modules\nunjucks\src\environment.js:299:9)
       at handle ([prj_root]\node_modules\nunjucks\src\environment.js:311:11)
       at [prj_root]\node_modules\nunjucks\src\environment.js:323:9
       at next ([prj_root]\node_modules\nunjucks\src\lib.js:281:7)
       at Object.asyncIter ([prj_root]\node_modules\nunjucks\src\lib.js:287:3)
       at Environment.getTemplate ([prj_root]\node_modules\nunjucks\src\environment.js:305:9)
       at Environment.render ([prj_root]\node_modules\nunjucks\src\environment.js:344:10)
       at [prj_root]\pages\index.js:240:60
       at [prj_root]\node_modules\q\q.js:1249:26
       at _fulfilled ([prj_root]\node_modules\q\q.js:854:54)
       at Promise.then.Q.nextTick.self.promiseDispatch.done ([prj_root]\node_modules\q\q.js:883:30)
       at Promise.__dirname.Promise.promise.promiseDispatch ([prj_root]\node_modules\q\q.js:816:13)
       at [prj_root]\node_modules\q\q.js:570:49
       at runSingle ([prj_root]\node_modules\q\q.js:137:13)
       at flush ([prj_root]\node_modules\q\q.js:125:13)
       at process._tickCallback (internal/process/next_tick.js:150:11)

not sure how can it help

@evanre
Copy link

evanre commented May 8, 2018

+1 Please, it's a very big problem to search the "needle" in the haystack.
fileName var shows only a tamplates path even if typos in included macroses.

@fdintino
Copy link
Collaborator

fdintino commented May 8, 2018

I have a fix for this that I'll be pushing out shortly.

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

Successfully merging a pull request may close this issue.

4 participants