-
-
Notifications
You must be signed in to change notification settings - Fork 235
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/[email protected] module not found error #1961
Comments
Same issue here. Only managed to get it working using next 13.4.4 and @module-federation/nextjs-mf 6.0.4. Upgrading nextjs-mf to version 8+ causes the same module not found error. Even this demo throws the same error message. |
I have that same problem. Version 8.1.3 works in dev mode, it does not work after build. When I upgrade to a higher version, I get a Module not found error. The only version I can run right now is 5.12.11. |
I found that there are two (at least) issues on windows. One is with how the webpack path is calculated and the other is the entry file located at node_modules\.federation. Fixing both of those allows the app to start. Running on Windows normalizeWebpackPath: =========webpackErrLocation=============== at webpack (C:\code\TestApp\node_modules\webpack\lib\webpack.js:167:32)
=========webpackLocationWithDetail======== C:\code\TestApp\node_modules\webpack\lib\webpack.js:167:32
=========webpackPath====================== C node_modules\.federation import federation from 'C:\code\TestApp\node_modules\@module-federation\webpack-bundler-runtime\dist\index.cjs.js';
import plugin_0 from 'C:\code\TestApp\node_modules\@module-federation\nextjs-mf\dist\src\plugins\container\runtimePlugin.js';
__webpack_require__.federation = { ...federation, ...__webpack_require__.federation };
if (!__webpack_require__.federation.instance) {
__webpack_require__.federation.initOptions.plugins = ([
plugin_0(),
])
__webpack_require__.federation.instance = __webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);
if (__webpack_require__.federation.attachShareScopeMap) {
__webpack_require__.federation.attachShareScopeMap(__webpack_require__)
}
if (__webpack_require__.federation.installInitialConsumes) {
__webpack_require__.federation.installInitialConsumes()
}
} Running on Windows WSL normalizeWebpackPath: =========webpackErrLocation=============== at webpack (/root/code/TestApp/node_modules/webpack/lib/webpack.js:167:32)
=========webpackLocationWithDetail======== /root/code/TestApp/node_modules/webpack/lib/webpack.js:167:32
=========webpackPath====================== /root/code/TestApp/node_modules/webpack/lib/webpack.js` node_modules\.federation import federation from '/root/code/TestApp/node_modules/@module-federation/nextjs-mf/node_modules/@module-federation/webpack-bundler-runtime/dist/index.cjs.js';
import plugin_0 from '/root/code/TestApp/node_modules/@module-federation/nextjs-mf/dist/src/plugins/container/runtimePlugin.js';
__webpack_require__.federation = {...federation,...__webpack_require__.federation};
if(!__webpack_require__.federation.instance){
__webpack_require__.federation.initOptions.plugins = ([
plugin_0(),
])
__webpack_require__.federation.instance = __webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);
if(__webpack_require__.federation.attachShareScopeMap){
__webpack_require__.federation.attachShareScopeMap(__webpack_require__)
}
if(__webpack_require__.federation.installInitialConsumes){
__webpack_require__.federation.installInitialConsumes()
}
} |
Looks like this is windows related. |
Same issue here |
Same issue here. |
I have same issue in linux, Nextjs 14.0.1, module-federation 8.1.10 and webpack 5.90.1. Need the solution for this error |
I have same issue in linux, Nextjs 14.1.0, module-federation 8.1.10 and webpack 5.90.1. Need the solution for this error |
Hey everyone, remember to edit your "scripts": {
"dev": "rimraf .next && NEXT_PRIVATE_LOCAL_WEBPACK=true next dev",
"build": "NEXT_PRIVATE_LOCAL_WEBPACK=true next build"
// ...
}
|
this doesn't fix the makeSerializable error |
same issue here |
I receive this error too. |
try latest version. If windows user use WSL. you can try .env as well and set it in there |
@ScriptedAlchemy I'm on 5.12.7 and wanted to upgrade it to 8.2.2. |
@ScriptedAlchemy Same error
script from
It says,
|
|
Yeah when enabled server plugin push, that external warning is fine. It works. |
Set env var like all my examples show on package json scripts. Next private local webpack or whatever it's called. That fixes serializeable error |
@ScriptedAlchemy I'm also facing the same issue with Nextjs 14.1.4 and module-federation 8.3.3 |
Tried in ubuntu wsl, but still getting the same error
But suprisingly v8.1.3 works well but having a bulk of warnings |
⚠ external "shop@http://localhost:3001/_next/static/chunks/remoteEntry.js" Import trace for requested module: |
Same error 😢
add
-> Error: Cannot find module /node_modules/next/dist/compiled/lib/util/makeSerializable |
Not an error or issue. |
Install webpack. Not sure if next 12 allows the override var or not. |
Thank you reply :) |
Resolved after version upgrade |
I'm receiving this same error here. Does someone knows how to fix this issue? |
Hi, I have expressjs with ts, webpack only for build bundles, and another project with commonjs and webpack i have this: commonjs repo
I use In my expressjs project:
in mi app route:
I don't know why im getting this error:
|
"@module-federation/nextjs-mf": "^8.2.0", this is my next.config.js for app1 module.exports = {
}, this is my next.config.js for app2 `const NextFederationPlugin = require("@module-federation/nextjs-mf"); module.exports = {
}, this is where i am importing my remote component `const NextFederationPlugin = require("@module-federation/nextjs-mf"); module.exports = {
}, this is my package.json
Please provide some fixes. |
For those struggling with the Error:
|
You didn't apply plugin to server. But your import isn't wrapped in typeof window check. So server try to import the module you don't provide a remote for. |
Support for next is ending |
Describe the bug
@module-federation/[email protected] throw module not found error when start dev server, but the same code works fine in codesandbox, reinstall it didn't work either, but version 8.1.3 works fine.
dependencies:
Reproduction
https://codesandbox.io/p/devbox/module-federation-x4qjrt?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clreaqnam0007356hcnits3rr%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clreaqnal0002356hg57oqztm%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clreaqnal0004356hry63c7rh%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clreaqnal0006356htc9yst8k%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clreaqnal0002356hg57oqztm%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clreaqnak0001356h0upnwz9u%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%257D%255D%252C%2522id%2522%253A%2522clreaqnal0002356hg57oqztm%2522%252C%2522activeTabId%2522%253A%2522clreaqnak0001356h0upnwz9u%2522%257D%252C%2522clreaqnal0006356htc9yst8k%2522%253A%257B%2522id%2522%253A%2522clreaqnal0006356htc9yst8k%2522%252C%2522activeTabId%2522%253A%2522clrebaq6202p9356hd8rea85b%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522clrebaq6202p9356hd8rea85b%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%255D%257D%252C%2522clreaqnal0004356hry63c7rh%2522%253A%257B%2522id%2522%253A%2522clreaqnal0004356hry63c7rh%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clreb65fh02d7356hxtqmjowg%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TERMINAL%2522%252C%2522shellId%2522%253A%2522clreb66p200bxefgeerx9e7cs%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clreb65fh02d7356hxtqmjowg%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D
Used Package Manager
npm
System Info
Validations
The text was updated successfully, but these errors were encountered: