-
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
Parse error with each helper: Expecting "ID", got undefined #269
Comments
@ustun, You'll need to show us a bit more code before we can really properly debug this. It would be most helpful if you could put together a jsfiddle for this. |
@wagenet Thanks for the fast response. The problem is, I can't even demonstrate it, as it is the same as the simple #each example on the main page. If I try it in jsfiddle, or even on the Chrome console, inputting the text, it works, but for some reason, the text returned by html() fails. I'm wondering if it is somehow getting confused by newlines. Here is the console session. As you can see, if I enter the template manually, it works. template = $("#people-in-clients-template").html()
Now trying manually:
Trimming the html() output has no effect either. So,
|
It seems like there is some binary data in my template:
|
This is the charcodes of the problematic template: a = [10, 10, 123, 123, 32, 35, 101, 97, 99, 104, 32, 112, 101, 111, 112, 108, 101, 32, 125, 125, 10, 123, 123, 32, 116, 104, 105, 115, 32, 125, 125, 10, 123, 123, 32, 47, 101, 97, 99, 104, 32, 125, 125, 10, 10] b=""; for (i = 0; i < a.length; i++) { t = template({"people: ['foo','bar']}); Here is the jsfiddle: |
OK, the issue is pretty simple actually, not related to non-printing chars, but my server side templating engine put a space before }}.
|
Seems like bad encoding vs an actual bug. |
I get the following error trying the example in the docs:
Uncaught Error: Parse error on line 3:
{{ #each people }} <l
-------^
Expecting 'ID', got 'undefined'
The text was updated successfully, but these errors were encountered: