-
Notifications
You must be signed in to change notification settings - Fork 2k
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
If helper can generate several syntax errors that aren't very useful #1548
Comments
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Sep 9, 2019
fixes handlebars-lang#1548 - add a guard to show readable syntax error for if / unless helper - prevents against 3 different errors that can be generated by different systax errors
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Sep 9, 2019
fixes handlebars-lang#1548 - add a guard to show readable syntax error for if / unless helper - prevents against 3 different errors that can be generated by different systax errors
related to #1549 |
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
fixes handlebars-lang#1548 - add a guard to show readable syntax error for if / unless helper - prevents against 3 different errors that can be generated by different systax errors
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
fixes handlebars-lang#1548 - add a guard to show readable syntax error for if / unless helper - prevents against 3 different errors that can be generated by different systax errors
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
fixes handlebars-lang#1548 - add a guard to show readable syntax error for if / unless helper - prevents against 3 different errors that can be generated by different systax errors
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
ErisDS
added a commit
to ErisDS/handlebars.js
that referenced
this issue
Oct 25, 2019
fixes handlebars-lang#1548 - add a guard to show readable syntax error for if / unless helper - prevents against 3 different errors that can be generated by different systax errors
Released in 4.5.0 |
ErisDS
added a commit
to TryGhost/Ghost
that referenced
this issue
Nov 25, 2021
refs: #10496 refs: handlebars-lang/handlebars.js#1548 - For a while, handlebars would and could generate quite a lot of obscure sytnax error messages for malformed helpers that we couldn't catch in gscan - This was fixed in handlebars-lang/handlebars.js#1548 - We have also since added AST parsing to gscan, so if there are more obscure syntax errors, we should be able to add rules to catch them - Therefore, this additional, overly specific code block isn't needed anymore, so let's clean it up!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you write a malformed
{{#if}}
helper with too many arguments, you get weird syntax errors that are different depending on just how you malformed the helper:{{#if anything_goes_here "string"}}
{{#if anything_goes_here undefined}}
{{#if anything_goes_here null}}
Here's a JS Fiddle demonstrating these errors
https://jsfiddle.net/m5a9q3b0/3/
Obviously, the if statement examples are incorrect, but the varied weird errors that get generated are the problem. In Ghost themes we regularly see all 3 of these errors, and it's clear noone understands what they mean or how to fix them.
We just added an ugly workaround to Ghost you can see here
The text was updated successfully, but these errors were encountered: