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
// vue.config.js
module.exports = {
publicPath: '/',
};
You actually want to add the publicPath to your vue.config.js file
https://stackoverflow.com/a/56320964/1321009 does work if you application is deployed at http://example.com
If you deployed it at http://example.com/something
Then you would need to go in and change it when deploying, annoying to say the least.
with vue.config.js file just set it like this
// vue.config.js
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? '/something/'
: '/'
};