Skip to content

Commit d6c60f8

Browse files
committed
feat(core): better error stack trace for router components
fixes #4250
1 parent ffb5c8c commit d6c60f8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/modules/router/async-component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function asyncComponent(router, component, resolve, reject) {
77
})
88
.catch((err) => {
99
reject();
10-
throw new Error(err);
10+
throw new Error(err, { cause: err });
1111
});
1212
}
1313
if (component instanceof Promise) {

src/core/modules/router/component-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default {
117117
})
118118
.catch((err) => {
119119
reject(err);
120-
throw new Error(err);
120+
throw new Error(err, { cause: err });
121121
});
122122
}
123123
let cachedComponent;

0 commit comments

Comments
 (0)