Questions tagged [webpack-module-federation]

458 questions
8
votes
1 answer

React.Lazy not working when consuming Micro frontend with webpack 5 and plugin Module Federation

What is happening is that I am consuming a Micro front-end through module federation, but even using React.Lazy the bundle (remoteEntry) is loaded at the start of the application, without accessing the route where the component is being imported. To…
8
votes
1 answer

Uncaught ChunkLoadError: Loading chunk | Module Federation webpack 5 while loading CDN module

Implemented Module Federation for Host and Remote Application. For the Remote application, federated module is uploaded on a CDN. While accessing the federated module on localhost, Host application is working fine but while accessing the module…
Ghost
  • 111
  • 1
  • 3
8
votes
1 answer

Webpack module federation using multiple git repos. Is there an example?

I am finding my way in the world of Webpack 5 module federation. There is a lot of good material and examples, like this and this. However, all examples I found are built inside single Git repos, often using npm workspaces and/or nested package.json…
Marco Faustinelli
  • 3,734
  • 5
  • 30
  • 49
8
votes
2 answers

Gatsby Module Federation CORS error and eager consumption issue

I am trying to use micro frontend app from gatsby using Module Federation. When I try to call the component which is running at localhost:3001, getting CORS error. any idea how to solve this? Here is my gatsby-node.js const packageJsonDeps =…
8
votes
1 answer

Angular module federation singleton service initiated multiple times

I was following this tutorial , and tried to share a library between the shell and the mfe1 app. I created the lib outside the workspace directory with one service injected in root, then added it to the tutorial package.json, and imported it in both…
Hekek
  • 81
  • 1
  • 5
8
votes
3 answers

Angular Module Federation BrowserModule

I am working on a module-federation prototype with webpack5 and the CLI11, mostly as described here: https://www.angulararchitects.io/aktuelles/the-microfrontend-revolution-part-2-module-federation-with-angular/. Basically, I have a host…
8
votes
1 answer

WP5 Module Federation: Singleton instantiated multiple times

Unfortunately, my repro for this is in a complex proprietary project, so I will do my best to explain what is going on. The closest example project to my use-case is this one:…
csvan
  • 8,782
  • 12
  • 48
  • 91
7
votes
1 answer

Module Federation, React, and Apollo 3 warnings

I'm building an app with micro-frontends using webpack 5's module federation plugin. Everything was fine until I started adding react hooks into my remote app. At that point I received errors about "invalid usage of hooks", i.e. I discovered I had…
7
votes
1 answer

Webpack module federation and react-router-dom

How to properly setup ModuleFederation and react-router-dom so that I can have Router and routes defined in Host app and remote Header app has components pointing to the routes defined in Host? However, the setup below fails to the…
7
votes
1 answer

ScriptExternalLoadError: Loading script failed

I am getting this error message :ScriptExternalLoadError: Loading script failed. (missing: http://localhost:3005/remoteEntry.js). when trying to load a remote app from the container app in development. I have this optimization (when I put them in…
Ron
  • 71
  • 1
  • 4
7
votes
2 answers

Angular MFE - WebPack5 - Module Federation - Image Path Issue

We are creating an MFE angular app using Module Federation WebPack 5 and ended up in an issue with the image source path. When we run the MFE alone, the image is loading(localhost:5000/assets/../angular.png) but when we run the host/shell app, the…
Keppy
  • 471
  • 1
  • 7
  • 23
6
votes
0 answers

Sharing AuthService data between shell & micro front end using module federation plugin - remote library

I have separate repositories for my shell & my microfrontends & I would like to share the auth service data between shell & microfrontends. I have used below article "Step 5: Share a Library of Your Monorepo" to create the AuthService shared…
6
votes
1 answer

Webpack Module Federation Error ScriptExternalLoadError: Loading script failed

NOTE: I tried accessing this directly in the browser https://localhost:5007/accom-web/dist/js/assets/browser-bundle/remoteEntryTest.js and I'm served the remoteEntryTest.js file. This is my webconfig in host. This is webconfig of remote…
hendrixchord
  • 4,662
  • 4
  • 25
  • 39
6
votes
1 answer

Angular webpack inserting styles.js without type module causes error '"Uncaught SyntaxError: Cannot use 'import.meta' outside a module

Angular webpack generates the tag for style.js without type=module. I started to use webpack-module federation and now I get the error: styles.js:3277 Uncaught SyntaxError: Cannot use 'import.meta' outside a module. In one scss stylesheet I use…
Ron Jonk
  • 706
  • 6
  • 16
6
votes
0 answers

How to share up-to-date global context between Container app and micro-frontend app?

I am using webpack module federation plugin, and there are Container and Micro frontend apps (both are written on React). Based on the new requirement I should implement an authentication logic using a third-party service Auth0 and…
s_kamianiok
  • 462
  • 7
  • 24
1
2
3
30 31