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

Unhelpful syntax error message #16322

Closed
GuillaumeGomez opened this issue Mar 5, 2018 · 3 comments · Fixed by #16326
Closed

Unhelpful syntax error message #16322

GuillaumeGomez opened this issue Mar 5, 2018 · 3 comments · Fixed by #16326

Comments

@GuillaumeGomez
Copy link

I just updated to ember 3 and got the following error (everything else is working fine):

Uncaught Error: SYNTAX ERROR: #if requires a single argument

Considering the size of the codebase, I can't figure out where this error comes from (already looked at all #if so I suppose I missed one...) and didn't find out how or where it was generated in this repository so I can't send a PR either.

Could you add the full #if syntax please? It'd be really helpful...

@rwjblue
Copy link
Member

rwjblue commented Mar 5, 2018

Thanks for reporting! We definitely consider bad error messages like this to be bugs.

The error is being thrown here. Sadly, by that point in the process we have lost the original syntax and source locations.

I'd propose making an "invalid-syntax-detection" AST transform that we can use to move this specific error (and perhaps any other statically detectable errors that are being thrown in the opcode compiler) so that it can include the template path, line number, and column.

@rwjblue
Copy link
Member

rwjblue commented Mar 5, 2018

For anyone looking to pick this up, we need to do something like:

@GuillaumeGomez
Copy link
Author

What I had in mind was way simpler but this new solution might be more helpful (I just wanted to print the arguments...). I don't have enough time to implement this myself for the moment but if it's still not fixed next time I pass by, I'll give it a look.

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

Successfully merging a pull request may close this issue.

2 participants