I'm having trouble with the production build of my Vuejs app.
I'm using the npm run build
command for creating the production build and serve -s dist
to run the build. Vue router is implemented and works fine for every path except for one which is parameterized(product
). My index.js
:
export default new Router({
routes: [
{
path: '/',
component: Layout,
children:[
{
path:'/',
component:Home,
name:'Home'
},
{
path:'/shop',
component:Shop,
name:'Shop'
},
{
path:'/product/:id', // navigating to this one throws the error
component:Product,
name:'Product'
},
// ...
]
}
],
mode:'history'
}
The error looks like this Uncaught SyntaxError: Unexpected token '<'
and occurs in the manifest.xxx.js
, vendor.xxx.js
and app.xxx.js
. I inspected the source code of those js files but couldn't find a '<' which is out of place.
If I run the dev server using npm run dev
, this error doesn't occur.
Does anyone have an idea what might cause this behavior? Thanks in advance for your help!