core icon indicating copy to clipboard operation
core copied to clipboard

Build fails with latest @module-federation/typescript

Open ATakaSKY opened this issue 1 year ago • 0 comments

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:

Screenshot 2024-05-04 at 6 08 39 PM Screenshot 2024-05-04 at 5 23 14 PM

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

ATakaSKY avatar May 04 '24 07:05 ATakaSKY