Skip to content

Commit 5b637c3

Browse files
authored
fix(data-prefetch): the prefetch exports type is promise or function (#3347)
1 parent 3ae5353 commit 5b637c3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/nice-suns-eat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/data-prefetch': patch
3+
---
4+
5+
fix(data-prefetch): the prefetch exports type is promise or function

packages/data-prefetch/src/prefetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class MFDataPrefetch {
9999
const exportsPromise =
100100
typeof exportsPromiseFn === 'function'
101101
? exportsPromiseFn()
102-
: Promise.resolve({});
102+
: exportsPromiseFn;
103103
const resolve = exportsPromise.then(
104104
(exports: Record<string, Record<string, any>> = {}) => {
105105
// Match prefetch based on the function name suffix so that other capabilities can be expanded later.

0 commit comments

Comments
 (0)