I’m using version 14 of Next.js. Below is my current next.config.mjs
setup:
export default (stage, { baseConfig }) => {
const newConfig = {
...baseConfig,
webpack(config, { isServer }) {
config.plugins.push(
new ModuleFederationPlugin({
name: 'remoteApp',
filename: 'static/remoteEntry.js',
exposes: {
'./Button': './pages/components/Button',
// Add additional components here
},
shared: {
react: { singleton: true, eager: true },
'react-dom': { singleton: true, eager: true },
}
})
);
return config;
}
};
return newConfig;
};
However, I’m encountering the following error when I run the app:
shell-app3@0.1.0 dev
next dev
▲ Next.js 14.2.16
Local: http://localhost:3000
The application starts successfully but then throws this error:
TypeError: The 'compilation' argument must be an instance of Compilation
Any insights on how to resolve this issue?