core
core copied to clipboard
Build fails with latest @module-federation/typescript
Describe the bug
Hi team. First off, amazing work on this new version of module federation.
I am trying to upgrade to 2.0 and added these two packages to latest versions: @module-federation/enhanced and @module-federation/typescript. However when I try to run build, I am getting below stack:
Here's my webpack config for reference:
const commonConfig = require('./webpack.common');
const { FederatedTypesPlugin } = require('@module-federation/typescript');
const { ModuleFederationPlugin } = require('@module-federation/enhanced');
const federationConfig = {
name: 'testMF',
filename: 'remoteEntry.js',
exposes: {
'./testComponent': './src/TestViewRemote.tsx',
},
};
const config = {
module: commonConfig.module,
resolve: commonConfig.resolve,
output: {
publicPath: 'auto',
},
plugins: [
new ModuleFederationPlugin(federationConfig),
new FederatedTypesPlugin({
federationConfig,
}),
],
externals: {
// Don't bundle react, react-dom or highcharts
react: 'React',
'react-dom': 'ReactDOM',
highcharts: 'Highcharts',
'highcharts/highstock': 'Highcharts',
},
};
module.exports = config;
I'm not sure if this information is sufficient to understand the cause of the issue. Please let me know if you require additional details. Thank you for your attention!
Versions:
@module-federation/typescript: 3.1.2
@module-federation/enhanced: 0.1.11
webpack: ^5.75.0
Used Package Manager
npm
System Info
System:
OS: macOS 14.4.1
CPU: (10) arm64 Apple M1 Pro
Memory: 1.80 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.7.3 - /opt/homebrew/bin/node
Yarn: 1.22.22 - ~/Desktop/project/node_modules/.bin/yarn
npm: 10.5.0 - /opt/homebrew/bin/npm
Browsers:
Chrome: 124.0.6367.119
Firefox: 121.0
Safari: 17.4.1
Validations
- [X] Read the docs.
- [X] Read the common issues list.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Module federation issue and not a framework-specific issue.
- [X] The provided reproduction is a minimal reproducible example of the bug.