Connor Leech Connor Leech - 1 year ago 229
AngularJS Question

'Error: [$parse:lexerr] Lexer Error: Unexpected next character' on heroku deploy

I wrote an angular app using yeoman generator. It works great in development, but after I deploy to heroku and visit a specific page I get this error:

Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 0-0 [\] in expression [\].$parse/lexerr?p0=Unexpected%20nextharacter%20&p1=s%200-0%20%5B%5C%5D&p2=%5C
at Zd.throwError (
at Zd.lex (
at $d.parse (
at e.parseAs (
at Object.e.(anonymous function) [as parseAsResourceUrl] (
at q (
at h (

This description says the error occurs when an expression has a lexical error.

What's that and why is it only showing up in production?

Answer Source

I had some error while I used ng-click

<a ng-click="#/search/San+Francisco">test</a>

instead of ng-href

<a ng-href="#/search/San+Francisco">test</a>

I hope it might help

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download