You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When `exposes` is set in the project, it will be regarded as a producer. To ensure that the producer resources can be loaded normally by consumers, `@module-federation/modern-js` and `@module-federation/rsbuild-plugin` will set `Access-Control-Allow-Origin` to `*` and issue a warning at the same time.
87
+
88
+
#### Solutions
89
+
90
+
*[Modern.js]: Set [devServer.headers](https://modernjs.dev/configure/app/tools/dev-server.html#headers) value to the specified domain whitelist instead of `*`
91
+
92
+
*[Rsbuild]: Set [server.cors.origin](https://rsbuild.dev/config/server/cors#origin) value to the specified domain whitelist instead of `*`
'View https://module-federation.io/guide/troubleshooting/other.html#cors-warn for more details.',
426
+
];
427
+
if(
428
+
typeofdevServerConfig!=='object'||
429
+
!('headers'indevServerConfig)
430
+
){
431
+
corsWarnMsgs.unshift(
432
+
'Detect devServer.headers is empty, mf modern plugin will add default cors header: devServer.headers["Access-Control-Allow-Headers"] = "*". It is recommended to specify an allowlist of trusted origins instead.',
'Detect devServer.headers is empty, mf modern plugin will add default cors header: devServer.headers["Access-Control-Allow-Headers"] = "*". It is recommended to specify an allowlist of trusted origins instead.',
188
+
'View https://module-federation.io/guide/troubleshooting/other.html#cors-warn for more details.',
0 commit comments