vue cli - Uncaught SyntaxError: Unexpected token <

前端 未结 14 2166
说谎
说谎 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:20

    I assume you are using the same console window that you used for vue ui or vue create to start the project?

    Then try to open a new console instance and run your project in it.

    In my case it worked and the problem was a overwriten enviroment variable in the first console.

    Wish you luck!

    0 讨论(0)
  • 2020-12-31 04:21

    Ran into this error randomly with Vue CLI 3 using serve + version 4.1 with all the CLI plugins.

    Event though I have Disabled Cache enabled in the web browsers inspection tools I had to resolve this for local development by clearing a Cache Storage:

    Open Inspection Tools > Application (tab) > Cache Storage (tree) > Right Click Delete on an entry that has a label ending with http://localhost:8080.

    I did not try Right Click on Cache Storage > Refresh Caches, might also work?

    If you are having this issue in production, this is not the answer for you, you need to resolve this in some other manner to ensure your app functions for your end users who wont know to do this...

    0 讨论(0)
提交回复
热议问题