Skip to content

Production mode refresh causing 404 #511

Closed
@jakubsikora

Description

@jakubsikora

I have a simple router setup

const router = new Router({
  mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: '/foo',
    },
    {
      path: '/foo',
      name: 'foo',
      component: Foo,
    },
  ],
});

In dev mode is all working fine. When i run npm run build and generate static files in the dist folder and then serv it let say using npm http-server everytime I refresh from e.g. localhost:8080/foo I'm getting 404.
I noticed that issue when I was trying to config gh-pages which base url is username.github.io/repo_name/.

Is there something I didn't setup properly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions