karma-runner / karma-ng-html2js-preprocessor

A Karma plugin. Compile AngularJS 1.x and 2.x templates to JavaScript on the fly.
MIT License
266 stars 146 forks source link

SyntaxError: Parse error - unexpected characters appears in the template js files #85

Open franksongca opened 8 years ago

franksongca commented 8 years ago

the template js file created by html2js preprocessor contains some strange characters that caused the error: SyntaxError: Parse error.

For example, the error message: PhantomJS 1.9.8 (Mac OS X 0.0.0) SyntaxError: Parse error at http://localhost:9777/base/app/views/fido-header-reference.html.js?9ac748880914d633717d67a5ef14c1b66e6275cd:189

I looked into the file http://localhost:9777/base/app/views/fido-header-reference.html.js at line 189, .............\')[1]===\'viewInvoice\'}">
\n' +

Please notice that strange characters 
 appears in it. I've verified multiple files with the same error, the same strange characters appears.

Please verify and verify.

Thanks. Frank

kosich commented 8 years ago

@franksongca , had similar problem and in my case the utf-8 symbol was really present in the source html. So removing all such occurrences helped.