Error: Cannot find module 'D:\NEXTJS\sample-next-micro\node_modules\next\dist\compiled\lib\ModuleNotFoundError'
apipkurniawan opened this issue · 1 comments
apipkurniawan commented
when npm run dev, i get this error
Error: Cannot find module 'D:\NEXTJS\sample-next-micro\node_modules\next\dist\compiled\lib\ModuleNotFoundError'
how to fix it?
my package.json
...
"dependencies": {
"@module-federation/nextjs-mf": "^8.6.3",
"next": "^14.2.13",
"react": "^18",
"react-dom": "^18",
"webpack": "^5.95.0"
},
...
my next.config.js
// eslint-disable-next-line @typescript-eslint/no-require-imports
const NextFederationPlugin = require("@module-federation/nextjs-mf");
module.exports = {
webpack(config, options) {
if (!options.isServer) {
config.plugins.push(
new NextFederationPlugin({
name: "home",
remotes: {},
filename: "static/chunks/remoteEntry.js",
exposes: {
"./home": "./src/pages/index.tsx",
},
shared: {},
extraOptions: {},
})
);
}
return config;
},
};
ScriptedAlchemy commented
Read the docs