File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/data-prefetch/src Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,10 @@ export const prefetchPlugin = (): ModuleFederationRuntimePlugin => ({
104104 return options ;
105105 }
106106
107+ // Check if prefetch is already initiated by initContainer
107108 const inited = loadingArray . some ( ( info ) => info . id === id ) ;
108- if ( ! inited ) {
109+ if ( inited ) {
110+ // Prefetch already set up by initContainer, don't interfere
109111 return options ;
110112 }
111113
@@ -125,11 +127,7 @@ export const prefetchPlugin = (): ModuleFederationRuntimePlugin => ({
125127 prefetchUrl = getResourceUrl ( snapshot , snapshot . prefetchEntry as string ) ;
126128 }
127129
128- const index = loadingArray . findIndex ( ( loading ) => loading . id === id ) ;
129- // clear cache
130- if ( index !== - 1 ) {
131- loadingArray . splice ( index , 1 ) ;
132- }
130+ // Only set up prefetch if not already done by initContainer
133131 const promise = instance . loadEntry ( prefetchUrl ) . then ( async ( ) => {
134132 const projectExports = instance ! . getProjectExports ( ) ;
135133 if ( projectExports instanceof Promise ) {
You can’t perform that action at this time.
0 commit comments