After deploying my unminified code successfully, I proceed to run grunt build
and deploy from the dist
folder. However, upon checking one of the pages, I encounter a breakage with an error in the console:
Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 0-0 [\] in expression [\].
http://errors.angularjs.org/1.2.6/$parse/lexerr?p0=Unexpected%20nextharacter%20&p1=s%200-0%20%5B%5C%5D&p2=%5C
at https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:3:30474
at Zd.throwError (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:14396)
at Zd.lex (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:13696)
at $d.parse (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:16445)
at https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:5:13197
at e.parseAs (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:5:23401)
at Object.e.(anonymous function) [as parseAsResourceUrl] (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:5:23604)
at https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:28873
at q (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:4:23046)
at h (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:4:19250)
My suspicion lies on an expression present on the page which could be causing the issue:
ng-include='"views/posts.html"'
In the dist folder on github, the tag appears as follows:
ng-include="\"views/posts.html\""
I'm curious about what grunt build
is doing to disrupt my code. It seems to function correctly when deploying from app/
, but not under dist/
.
Is there a more effective way to craft my ng-include
?