OrchardCMS/OrchardCore · error · Error
Invalid async component load result:
Error message
Invalid async component load result:
What it means
Same dev-mode validation as error 430 but in the UMD/dev build vue.runtime.js: after async component resolution and ES-module default interop, Vue requires the result to be an object or function and throws otherwise. It signals that a lazily loaded component factory resolved to something that is not a Vue component definition.
Solutions
- Add/restore `export default` of the component options object in the lazily imported file.
- Map named exports explicitly: () => import('./x').then(m => m.default || m.X).
- Log or breakpoint inside the factory to inspect the resolved module shape and correct the access path.
- Fix the import path so it targets the actual component module.
- Confirm the dev build's stricter dev-only assertion is the surface: the same code may appear to 'work' silently in prod, so fix the module shape rather than suppressing the error.
Example fix
// before
const AsyncList = () => import('./list-module'); // module has no default export
// after
const AsyncList = () => import('./list-module').then(m => m.List);
// or add `export default List` in list-module.js Defensive patterns
Strategy: type-guard
Validate before calling
import('./list-module').then(m => { const c = m.default || m.List; if (!c || (typeof c !== 'object' && typeof c !== 'function')) throw new TypeError('loader must resolve to object/function, got ' + typeof c); return c; }) Type guard
function isValidAsyncComp(v) { return v != null && (typeof v === 'object' || typeof v === 'function'); } Try / catch
try { const m = await loader(); if (!isValidAsyncComp(m.default || m)) throw new Error('Invalid async component module shape'); return m.default || m; } catch (e) { console.error('Lazy component failed:', e); return FallbackComponent; } Prevention
- Add `export default` to every lazily loaded component module
- Use .then(m => m.default || m.X) instead of returning the raw namespace
- Fix CommonJS interop: don't overwrite module.exports with a non-component value
- Verify the bundled module shape after build-tool changes (webpack/Vite/TS)
- Write a unit test that resolves every lazy route and asserts a valid component
When it happens
Trigger: Async component definitions such as Vue.component('x', () => loadX()) or router route.component: () => import(...) whose promise resolves to a string, undefined, null, number, or a module object without a usable default/component export.
Common situations: Dynamic import of a file that only exports named helpers; CommonJS interop where module.exports was overwritten with a non-component value; a bundler returning an empty namespace object consumed as-is when the actual component is on m.default; renamed/moved files leaving the loader pointing at a stub.
Related errors
- Invalid async component load result
- Invalid async component load result
- Invalid async component load result
- Invalid async component load result:
- Standalone host is missing a <div id="media-gallery"> mount…
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/f85cd3657507feeb.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/vue-2.7.16/vue.runtime.js:3235
else {
throw err;
}
})
.then(function (comp) {
if (thisRequest !== pendingRequest && pendingRequest) {
return pendingRequest;
}
if (!comp) {
warn("Async component loader resolved to undefined. " +
"If you are using retry(), make sure to return its return value.");
}
// interop module default
if (comp &&
(comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
comp = comp.default;
}
if (comp && !isObject(comp) && !isFunction(comp)) {
throw new Error("Invalid async component load result: ".concat(comp));
}
return comp;
})));
};
return function () {
var component = load();
return {
component: component,
delay: delay,
timeout: timeout,
error: errorComponent,
loading: loadingComponent
};
};
}
function createLifeCycle(hookName) {
return function (fn, target) {View on GitHub (pinned to 4306c0717f)