New app not working on github pages


I have a new app that I created using the CLI. I am trying to view it on my github pages in this URL:

I did the following:

  1. npm run build
  2. cp -r dist/
  3. push the code to my github pages repo

but when I go to the js files failed to load. The docs ( talks about a file called vue.config.js but I don’t have it.

Here is my code:

Any tips are appreciated!


Your asset urls are pointing to the root directory instead of /food/.

needs to be:

So definitely a config issue. You’ll want to set the publicPath.

You can create a vue.config.js in your project root.

So your config should look like this:

module.exports = {
  publicPath: '/food/'

but it sounds like on your development machine you use root as your publicPath, so you may want to config it like

publicPath: process.env.NODE_ENV === 'production'
    ? '/food/'
    : '/'


Hi JamesThomson,

I’m having the same problem on my GH Pages Site. In the VuePress deployment docs, I see base rather than publicPath listed as the key for the site’s root directory.

Can you tell what I’m doing wrong here? 404 all day!