Skip to content

Commit f817674

Browse files
chore(runtime): remove duplicate registerRemotes warn (#3325)
Co-authored-by: Zack Jackson <[email protected]> Co-authored-by: ScriptedAlchemy <[email protected]>
1 parent 70c07d5 commit f817674

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.changeset/funny-drinks-bathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/runtime': patch
3+
---
4+
5+
chore(runtime): remove duplicate registerRemotes warn

packages/runtime/src/remote/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,18 +441,16 @@ export class RemoteHandler {
441441
} else {
442442
const messages = [
443443
`The remote "${remote.name}" is already registered.`,
444-
options?.force
445-
? 'Hope you have known that OVERRIDE it may have some unexpected errors'
446-
: 'If you want to merge the remote, you can set "force: true".',
444+
'Please note that overriding it may cause unexpected errors.',
447445
];
448446
if (options?.force) {
449447
// remove registered remote
450448
this.removeRemote(registeredRemote);
451449
normalizeRemote();
452450
targetRemotes.push(remote);
453451
this.hooks.lifecycle.registerRemote.emit({ remote, origin: host });
452+
warn(messages.join(' '));
454453
}
455-
warn(messages.join(' '));
456454
}
457455
}
458456

0 commit comments

Comments
 (0)