File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
packages/dts-plugin/src/server Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/dts-plugin ' : patch
3
+ ---
4
+
5
+ fix(dts-plugin): hold the broker server if the remote not start locally
Original file line number Diff line number Diff line change @@ -314,8 +314,19 @@ export class ModuleFederationDevServer {
314
314
'warn' ,
315
315
) ;
316
316
317
- this . _subscriberWebsocketMap [ identifier ] &&
318
- this . _subscriberWebsocketMap [ identifier ] . close ( ) ;
317
+ this . _subscriberWebsocketMap [ identifier ] ?. close ( ) ;
318
+ delete this . _subscriberWebsocketMap [ identifier ] ;
319
+ } ) ;
320
+
321
+ this . _subscriberWebsocketMap [ identifier ] . on ( 'error' , ( event ) => {
322
+ if ( 'code' in event && event . code === 'ETIMEDOUT' ) {
323
+ fileLog (
324
+ `Can not connect ${ JSON . stringify ( remote ) } , please make sure this remote is started locally.` ,
325
+ MF_SERVER_IDENTIFIER ,
326
+ 'warn' ,
327
+ ) ;
328
+ }
329
+ this . _subscriberWebsocketMap [ identifier ] ?. close ( ) ;
319
330
delete this . _subscriberWebsocketMap [ identifier ] ;
320
331
} ) ;
321
332
}
You can’t perform that action at this time.
0 commit comments