Skip to content

Commit eb87c72

Browse files
committed
feat(ujs) show errors when component can't be loaded
1 parent a53f29a commit eb87c72

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

react_ujs/src/getConstructor/fromRequireContextWithGlobalFallback.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ module.exports = function(reqctx) {
1111
try {
1212
// `require` will raise an error if this className isn't found:
1313
component = fromCtx(className)
14-
} catch (err) {
14+
} catch (firstErr) {
1515
// fallback to global:
16-
component = fromGlobal(className)
16+
try {
17+
component = fromGlobal(className)
18+
} catch (secondErr) {
19+
console.error(firstErr)
20+
console.error(secondErr)
21+
}
1722
}
1823
return component
1924
}

0 commit comments

Comments
 (0)