I create my project with vue-cli 3.0
. Initially it runs ok. But after I
then npm run serve
again, it keep throwing erro
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.