Reputation: 697
I ran npm run build
, successfully created Dist
folder, now opening index.html throws error :Failed to load resource: net::ERR_FILE_NOT_FOUND
what can be the possible issue here ?
Upvotes: 1
Views: 2310
Reputation: 697
I found adding
module.exports = {
publicPath: './'
};
to vue.config.js
solves it too, after which we can open index.html
from the dist
folder directly.
More about publicPath
in the docs.
Upvotes: 3
Reputation: 1549
Vue JS files are not supposed to simply be opened directly in the browser (using the file:// protocol). You must use a server for it to correctly work. The simplest solution if you use Google Chrome is to use this extension: Web Server for Chrome
Upvotes: 2