vue cli - Uncaught SyntaxError: Unexpected token <

前端 未结 14 2254
说谎
说谎 2020-12-31 03:39

I create my project with vue-cli 3.0. Initially it runs ok. But after I -c then npm run serve again, it keep throwing erro

14条回答
  •  难免孤独
    2020-12-31 04:06

    I had the same problem, I tried the removing node modules and npm install again but that didn't work.

    What did work was removing all the site data. You can do that (in Chrome) by opening the development tab (Ctrl+Shift+i), go to the 'application' tab, click "Clear storage" on the side panel and click on the "Clear site data" button.

    My guess is that I still had some old service-worker that intercepted the request and served the html file instead of the app.js. So if you have used PWA's before at the url "http://localhost:8080" this might solve the problem.

提交回复
热议问题