hjeti / vue-skeleton

A Vue skeleton
MIT License
108 stars 21 forks source link

Children path gives 404 #124

Closed paulinechi closed 2 years ago

paulinechi commented 2 years ago

Hi, I'm working on a Vue project built with the vue-skeleton (thanks for providing the template! Super helpful), and I'm trying to add new children paths under route /press, such as /press/article1 and /press/article2. I added the new children paths in routes.js as the following

export default [
{
    path: '/press',
    name: RouteNames.PRESS_RELEASE,
    component: PressReleaseList,
    children: [
      {
        path: 'article1',
        name: RouteNames.PRESS_RELEASE_ARTICLE,
        component: PressReleaseArticle,
      },
    ]
  }
} 

I'm then able to access /press but when I go to /press/article1 I got the following error:

http://localhost:8081/press/app.js net::ERR_ABORTED 404 (Not Found)

It seems to me that for child routes, the app.js is built not from root but from /press ? Any suggestion on how to debug this or how to fix this? Thank you in advance!

paulinechi commented 2 years ago

I've fixed the issue by adding <base href="/"> in , reference: https://github.com/gaearon/react-hot-loader/issues/620#issuecomment-321729281