Skip to content

Commit

Permalink
fix(component): fix loadComponents
Browse files Browse the repository at this point in the history
Ignore missing type errors
  • Loading branch information
gregberge committed Oct 30, 2018
1 parent 9dd599e commit bd2220c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/component/src/loadComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bd2220c

Please sign in to comment.