Syntax Error in Angular App: Unexpected token <

后端 未结 30 2144
独厮守ぢ
独厮守ぢ 2020-12-02 20:16

I have an Angular app which runs perfectly in my local and production environment.. After a tiny change I made, I ran the app locally and it works fine.. Then I built the pr

30条回答
  •  鱼传尺愫
    2020-12-02 20:45

    I found this to error to be a broad instance of many possible errors. In our application that was using Jhipster generated project, We added google analytics in the index.html. We also tried matomo analytics. Inside the index.html we have script tags as well.

    The error was that someone commented out a line of code in our google analytics snippet.

    here is an example of the code where the error lived:

    Notice the last three lines where there was . That cause the error for us.

    In index.html script tag, to comment out a line we use \\ double back slash. Someone may have attempted to comment this line out using .

    This is tricky cause it could have been anywhere.
    But its always a good place to start in the index.html

    Hope this helps a little.

提交回复
热议问题