-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module federation requesting remote component from wrong origin #3041
Comments
publicPath: auto or use https://module-federation.io/configure/getpublicpath.html |
I think the default is 'auto'. and I tried with 'getPublicPath' and webpack's 'output.publicPath'. But both failed. and |
Does it work if you don't set basepath on both apps. |
@ScriptedAlchemy Yes, it works perfectly. But it is a very specific scenario where I need to deploy to this subpath. |
Base path is not supported |
@ScriptedAlchemy but can it be considered in the next versions? |
Found the solution. check how to correctly configure publicPath:
|
when does the federation runtime support the getpublicpath configuration option? |
Public path is supported now |
There is no relevant instructions in https://module-federation.io/guide/basic/runtime.html |
Describe the bug
Using Module Federation plugin for nextjs.
We have 2 applications. (host and calc) When we try access the calc (http://localhost:3001/calc) on browser, using a remote component from host (http://localhost:3000/v2/). The browser is requesting the source from wrong origin.
It should be
http://localhost:3000/v2/_next/static/chunks/__federation_expose_Hello.js
There is some issue with module-federation when nextjs 'basePath' is populated.
check out the 'nextjs.config.js' of (calc http://localhost:3001)
and 'nextjs.config.js' of (host http://localhost:3000)
I tried to set an 'output.publicPath' in webpack but it didn't work
Reproduction
https://github.com/leolima/bug-mf/
Used Package Manager
yarn
System Info
Validations
The text was updated successfully, but these errors were encountered: