diff --git a/.changeset/funny-drinks-bathe.md b/.changeset/funny-drinks-bathe.md new file mode 100644 index 0000000000..30a7a07808 --- /dev/null +++ b/.changeset/funny-drinks-bathe.md @@ -0,0 +1,5 @@ +--- +'@module-federation/runtime': patch +--- + +chore(runtime): remove duplicate registerRemotes warn diff --git a/packages/runtime/src/remote/index.ts b/packages/runtime/src/remote/index.ts index 2bff2b2fbd..c27b2be6e1 100644 --- a/packages/runtime/src/remote/index.ts +++ b/packages/runtime/src/remote/index.ts @@ -441,9 +441,7 @@ export class RemoteHandler { } else { const messages = [ `The remote "${remote.name}" is already registered.`, - options?.force - ? 'Hope you have known that OVERRIDE it may have some unexpected errors' - : 'If you want to merge the remote, you can set "force: true".', + 'Please note that overriding it may cause unexpected errors.', ]; if (options?.force) { // remove registered remote @@ -451,8 +449,8 @@ export class RemoteHandler { normalizeRemote(); targetRemotes.push(remote); this.hooks.lifecycle.registerRemote.emit({ remote, origin: host }); + warn(messages.join(' ')); } - warn(messages.join(' ')); } }