Skip to content
Advertisement

ModuleFederationPlugin remote module is not being loaded

I have two apps.

  1. Container. Webpack
JavaScript

App.tsx

JavaScript

2nd App. Webpack

JavaScript

./src/portal.tsx

JavaScript

It should work smooth.

But it is failing because inside of webpack_modules exists webpack/container/reference/usersweb key, but when React.Lazy requiring remote model it is requiring
webpack/container/remote/usersweb/Portalscript which is not added and app crashes.

remoteEntry.js loaded properly and I may see userweb object in the console.

dependencies versions

“react”: “^17.0.2”, “webpack”: “5.21.2”, “typescript”: “^4.1.2”,

Advertisement

Answer

After 5 days debugging issue was in tsconfig.json

In order to proper load modules with ‘ts-loader’ need to add to compilerOptions

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement