问题
The vuejs common components which I created as a web-component and uploaded to npm doesn't work when I installed it to a different file. I think it's because of lazy-loading. I tried searching some fixes but I can't find that fixed my problem.
On chrome and firefox error images are provided
I am using this code on importing the components inside web-components.
components: {
'data-description-c': () => import(/* webpackChunkName: "data-description-c" */ './myPage/DataDescriptionC.vue'),
'data-count-c': () => import(/* webpackChunkName: "data-count-c" */'./myPage/DataCountC.vue')
},
Error on chrome:
[Vue warn]: Failed to resolve async component: function data_description_c() {
return __webpack_require__.e(/* import() | data-description-c */ 3).then(__webpack_require__.bind(null, "dffc"));
}
Reason: Error: Loading chunk 3 failed.
(missing: http://localhost:8080/idist-components.common.data-description-c.js)
[Vue warn]: Failed to resolve async component: function data_count_c() {
return __webpack_require__.e(/* import() | data-count-c */ 2).then(__webpack_require__.bind(null, "755f"));
}
Reason: Error: Loading chunk 2 failed.
(missing: http://localhost:8080/idist-components.common.data-count-c.js)
Error on firefox:
[Vue warn]: Failed to resolve async component: function data_description_c() {
return __webpack_require__.e(/* import() | data-description-c */ 3).then(__webpack_require__.bind(null, "dffc"));
}
Reason: Error: Loading chunk 3 failed.
(missing: http://localhost:8080/idist-components.common.data-description-c.js)
[Vue warn]: Failed to resolve async component: function data_count_c() {
return __webpack_require__.e(/* import() | data-count-c */ 2).then(__webpack_require__.bind(null, "755f"));
}
Reason: Error: Loading chunk 2 failed.
(missing: http://localhost:8080/idist-components.common.data-count-c.js)
来源:https://stackoverflow.com/questions/57234533/vuejs-lazy-loading-error-components-used-are-a-web-components-this-i-uploaded-t