I am trying to load component async. It works fine in production build but fails in development. I use hot module replacement for development and I get error on the console that component failed to load.
This is how I register my component:
Vue.component('product-page', ()=> import('./app/components/ProductPage.vue'));
Error:
vue.runtime.esm.js?2b0e:619 [Vue warn]: Failed to resolve async component: function () {
return Promise.all(/*! import() */[__webpack_require__.e(0), __webpack_require__.e(1), __webpack_require__.e(2), __webpack_require__.e(32)]).then(__webpack_require__.bind(null, /*! ././app/components/ProductPage.vue */ "./src/app/components/ProductPage.vue"));
}
In my webpack config, I have:
output:{
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js' ,
publicPath: 'http://localhost:8088/',
}
Is there any special configurations I need or what am I doing wrong?