Closed lapluviosilla closed 11 years ago
Well, the error message you're getting is strange, but the immediate problem i see is the syntax. The "No profile pic" isn't valid Emblem syntax. Try changing it to this and see what happens:
if profile_pic_url
img src=profile_pic_url
else
| No profile pic
Sorry, I put an old example. Regardless, even without the else I get the same error. Also, just if true
or = if true
by themselves causes it to blow up.
Here's what I'm actually doing:
if profile_pic_url
img src=profile_pic_url
else
i.img-polaroid.icon-user
The "if true" blowup makes sense -- I never implemented boolean literals since their use case seems kind of thin, though I'll open an issue for that in emblem.js since it might surprise some people.
Can you post a gist of the full template you're trying to compile? fwiw I think this is an emblem bug if it is one, not an emblem-brunch thing, but let's make sure.
By blowup I mean, it gives exactly the same error on runtime.
Oh, and copy and paste error, the browser error is actually: Uncaught SyntaxError: Unexpected token if
Can you see if you're still getting this error since #2 has been merged? I bumped the npm package version to 0.1.1
I believe this was fixed. Thank you.
Not sure if this is a emblem-brunch or emblem bug.
I have an emblem template with the following snippet:
If the application is compiled as usual with
brunch build
the output works just fine. However, if I compile withbrunch build --minify
then the output breaks. I get the following error in the browser:Uncaught SyntaxError: Unexpected token in templates.js
Also, if I remove the if blocks, the rest of the emblem template works fine.
I compared the two builds and found the following difference:
Non-Minified
Minified
The helpers[ =if] is what is breaking, as =if is not a valid js statement/token.