-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Next.js export with page-router and importRemote #1947
Comments
use |
Even with that and 8.1.5 the hooks don't seem to work? ayonix/mf-next-8-reproducer@00507bb
|
You only use it client side, so init should be wrapped so server doesn't throw in like if typeof window Is this throwing on server or client? |
The next host is built with export, so it's all client side. |
Ok I'll have to clone codebase and look |
Okay I found the issue of this. I have a fix in progress |
Theres a bug i need to fix in library. publicPath: 'http://localhost:3002/', |
@ayonix try this release of nextjs-mf 0.0.0-next-20240114005722 you need to also fix your ports, paths etc in the build configfs for the remote |
They're only wrong for serve, my use case is a next export though. I should've made that clearer, sorry. With nextjs-mf 0.0.0-next-20240114005722 the host doesn't build with the error: Error: Cannot find module '$path\Reproducer\host-app\node_modules\.pnpm\[email protected][email protected][email protected]\node_modules\next\dist\compiled\lib\util\makeSerializable'
I've seen this error with other versions of next-mf or maybe it was only with next14. Probably it only happens when using next with |
Pulling your repo, this seems to work on my end. That error looks like you have not set the following NEXT_PRIVATE_LOCAL_WEBPACK=true try using it on the command, not the .env file - i find .env file is not always reliable, maybe doesnt pick up in time for next buid. NEXT_PRIVATE_LOCAL_WEBPACK=true next export |
.env is checked in in the host-app.
as well as all of those with |
May I know if you are using the Windows operating system? There is currently an open issue regarding path normalization, and a pull request has been submitted to resolve this issue. However, it has not yet been merged into the codebase. The resolution is expected to be implemented next week. In the meantime, you can review the normalization pull request and apply a patch to your local package if necessary. |
Yes I am using windows, I'll wait then, thanks. |
Stale issue message |
Describe the bug
ModuleFederation seems to be broken for us when we upgrade to @module-federation/[email protected].
The same code is working with ^7.0.8. We are using next 13.5.6 with
export
.The host logs
Uncaught (in promise) Error: Cannot find module '$path\host-app\node_modules\.pnpm\[email protected]\node_modules\react\index.js'
and doesn't load the remote.If there is a better way to import a module via a dynamic name from a remote I'm happy to work around it.
Reproduction
https://github.com/ayonix/mf-next-8-reproducer
Used Package Manager
pnpm
System Info
Validations
The text was updated successfully, but these errors were encountered: