mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-25 15:24:15 +00:00
fix(component): fix loadComponents
Ignore missing type errors
This commit is contained in:
parent
9dd599e531
commit
bd2220c320
@ -40,7 +40,12 @@ export default function loadComponents(loadableState) {
|
||||
invariant(WEBPACK, '`loadComponents()` is only compatible with Webpack')
|
||||
|
||||
return Promise.all(
|
||||
loadableState.map(chunk => __webpack_require__.e(chunk)),
|
||||
loadableState.map(chunk => __webpack_require__.e(chunk)).catch(error => {
|
||||
// We can safely ignore "missing" type errors
|
||||
// we just want the bundle to be loaded, not the module installed
|
||||
if (error.message.match(/missing:/)) return
|
||||
throw error
|
||||
}),
|
||||
).catch(error => {
|
||||
warn('`loadComponents()` has failed')
|
||||
warn(error)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user