Having production error : TypeError: (void 0) is not a function at (.next/server/webpack-api-runtime.js:1:199) #18583
Unanswered
Likhitha4131
asked this question in
Q&A
Replies: 2 comments
-
Please open an issue in the nextjs repo, thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
This issue got resolved by vesion update of "@module-federation/nextjs-mf" to 8.8.3 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using webpack for module-federation in my next project
//Next.config.js
onst NextFederationPlugin = require("@module-federation/nextjs-mf");
const nextConfig = {
reactStrictMode: false,
basePath: "/dc",
env: {
BASE_PATH: process.env.BASE_PATH
},
eslint: {
ignoreDuringBuilds: true
},
typescript: {
ignoreBuildErrors: true
},
webpack(config) {
const nextWebConfig = { ...config };
nextWebConfig.resolve.alias.canvas = false;
nextWebConfig.plugins.push(
new NextFederationPlugin({
name: "dc",
filename: "static/chunks/remoteEntry.js",
exposes: {
'./canned': './src/components/CannedRemoteEntry.tsx'
}
})
);
},generateBuildId: async () => {
return "dc";
},
};
module.exports = nextConfig;
//package.json
{
"name": "dc",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@mantine/core": "^7.7.1",
"@mantine/dates": "^7.7.1",
"@mantine/hooks": "^7.7.1",
"@material-ui/core": "^5.0.0-beta.5",
"@material-ui/icons": "^4.11.3",
"@module-federation/nextjs-mf": "8.2.0",
"@mui/icons-material": "^5.15.15",
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5.15.14",
"@mui/x-data-grid": "^6.19.10",
"@mui/x-date-pickers": "^7.1.0",
"@mui/x-tree-view": "^7.3.0",
"@types/react-chartjs-2": "^2.5.7",
"axios": "^1.6.8",
"chart.js": "^4.4.2",
"chartjs": "^0.3.24",
"csurf": "^1.11.0",
"dayjs": "^1.11.10",
"env-cmd": "^10.1.0",
"express": "^4.19.2",
"html-webpack-plugin": "^5.6.0",
"moment": "^2.30.1",
"next": "14.1.4",
"next-auth": "^4.24.7",
"react": "^18.2.0",
"react-chartjs": "^1.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-select": "^5.8.0",
"react-select-async-paginate": "^0.7.4",
"sass": "^1.72.0",
"semver": "7.5.2"
},
"devDependencies": {
"@babel/core": "^7.24.5",
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
"@babel/preset-env": "^7.24.5",
"@babel/preset-react": "^7.24.1",
"@babel/runtime": "^7.24.6",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"babel-loader": "^9.1.3",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"cross-env": "^7.0.3",
"eslint": "^8n",
"eslint-config-next": "14.1.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5",
"webpack": "^5.90.0"
},
"resolutions": {
"semver": "7.5.2"
}
}
Please help me resolve this error
Beta Was this translation helpful? Give feedback.
All reactions