Skip to content

Commit

Permalink
fix: lazy module import always returns default module (#4148)
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 authored Jan 3, 2025
1 parent 9fe17b3 commit e08a987
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion framework/core/js/src/common/ExportRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,16 @@ export default class ExportRegistry implements IExportRegistry, IChunkRegistry {
// @ts-ignore
const wr = this._webpack_runtimes[namespace] ?? __webpack_require__;

return await wr.e(module.chunkId).then(wr.bind(wr, module.moduleId));
return await wr
.e(module.chunkId)
.then(wr.bind(wr, module.moduleId))
.then(() => {
const m = this.get(namespace, id);

m.default ??= m;

return m;
});
}

public clear(): void {
Expand Down

0 comments on commit e08a987

Please sign in to comment.