My project was initially set up using vue-cli 3.0
and everything was running smoothly. However, when I terminated it with <ctrl>-c
and tried running npm run serve
again, I kept encountering the following error:
Uncaught SyntaxError: Unexpected token <
The error pointed to the first line of app.js
, but after checking the console, I realized that the <
was actually coming from index.html
. This suggested that somewhere in the process, webpack
mistakenly treated index.html
as if it should be transpiled as part of app.js
.
Here are the packages I am currently using:
vue 3.0.0-rc.3 @vue/cli-plugin-babel ^3.0.0-beta.15 @vue/cli-plugin-eslint ^3.0.0-beta.15 @vue/cli-service ^3.0.0-beta.15
Is there a way to resolve this issue?
Update01
I ended up deleting the entire node-modules
folder and performing a fresh npm install
, which seemed to fix the problem. However, if anyone has any insights on why this occurred in the first place, please feel free to share.