Skip to content

Commit bd2220c

Browse files
committed
fix(component): fix loadComponents
Ignore missing type errors
1 parent 9dd599e commit bd2220c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/component/src/loadComponents.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ export default function loadComponents(loadableState) {
4040
invariant(WEBPACK, '`loadComponents()` is only compatible with Webpack')
4141

4242
return Promise.all(
43-
loadableState.map(chunk => __webpack_require__.e(chunk)),
43+
loadableState.map(chunk => __webpack_require__.e(chunk)).catch(error => {
44+
// We can safely ignore "missing" type errors
45+
// we just want the bundle to be loaded, not the module installed
46+
if (error.message.match(/missing:/)) return
47+
throw error
48+
}),
4449
).catch(error => {
4550
warn('`loadComponents()` has failed')
4651
warn(error)

0 commit comments

Comments
 (0)