Currently, I am attempting to asynchronously load a component. Surprisingly, it functions perfectly in the production build but encounters issues during development. During development, I utilize hot module replacement and encounter an error in the console stating that the component was unable to load.
This is how I define my component registration:
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 configuration, the following is included:
output:{
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js' ,
publicPath: 'http://localhost:8088/',
}
Do I require any specific configurations or what mistake am I making?