Questions tagged [webpack-module-federation]

458 questions
25
votes
4 answers

Webpack module federation is not working with eager shared libs

I was looking into Webpack 5 Module federation feature, and have some trouble understanding why my code does not work. The idea is pretty similar to what standard module federation examples do: app1 - is the host app app2 - is a remote exposing the…
volk
  • 762
  • 1
  • 6
  • 19
23
votes
5 answers

WP5 Module Federation: remoteEntry.js caching

With Webpack 5 module federation if remote entry is modified, you don't need to redeploy main module/application and the newest version of the module will be loaded when it's requested by the browser. I'm wondering: since the remote URL remains the…
16
votes
2 answers

Tree shaking of shared dependencies in webpack 5 module federation

I am working on an architecture for a dynamic dashboard with components fetched from different remote react bundles using webpack 5 module federation. I do have different libraries which are shared across some of these remote bundles. These packages…
15
votes
2 answers

Webpack module federation error: Cannot read properties of undefined (reading 'call')

I am trying to create the most basic webpack module federation proof of concept example. Webpack config in the host app: ... plugins: [ new ModuleFederationPlugin({ name: "hostApp", remotes: { libApp:…
Daniel
  • 1,431
  • 2
  • 16
  • 36
15
votes
4 answers

How to use Webpack Module Federation plugin with create-react-app without ejecting

Is there a way to use module federation using create-react-app without ejecting? I want to convert my existing react applications(created using CRA) to micro-frontends.
14
votes
3 answers

Serving styles and assets with Webpack 5 module federation

I've successfully implemented the relatively new webpack 5 module federation system in my Angular 11 app, so it can load modules remotely on-demand from another build. One thing I've found nothing about is how to handle assets like stylesheets and…
John White
  • 917
  • 1
  • 12
  • 26
14
votes
1 answer

Mocking federated modules in host application for jest

Question is exactly same here in fact but has different context: How to mock not installed npm package in jest? I am part of a project where new Module Federation is used from webpack. Basically, I have a host app and it uses remote apps. I am doing…
13
votes
2 answers

Webpack Module Federation Unsatisfied version 11.x.x of shared singleton module @angular/common (required ^7.2.0)

I am trying to get my rather complicated monolithic app to work with Module Federation. My webpack config looks like that plugins: [ new ModuleFederationPlugin({ remotes: { "mfe1":…
gleixnerp
  • 171
  • 1
  • 2
  • 8
12
votes
0 answers

Deployable MFE using nextjs and module federation

does anyone has experience using Nextjs and module federation for creating the MFEs that can be deployable? I can see there are some limitations and we'll lose SSR in that case like deploying micro frontends with module federation and nextjs or we…
10
votes
0 answers

Module federation and React Context hooks

When using React useContext hooks, it currently requires an import from a component higher up in the tree to pass in the Context object. Say for example: // index.jsx export const MyContext = React.useContext('1') export function MyApp(props){ …
9
votes
2 answers

How do I share a MUI 5 theme across multiple Micro front ends using Module Federation

I currently have multiple React v17 apps which utilise Module Federation from Webpack 5. I would like for my MUI 5 theme to be shared across all of these micro frontends without having a there own ThemeProvider wrapped around each exposed component.…
Kitson88
  • 2,889
  • 5
  • 22
  • 37
9
votes
0 answers

Does Webpack plugin for MicroFrontends support flutter web app be used as MicroFrontend inside angular app?

I have angular application which works independently. Also there is a flutter web build for a certain feature which runs independently. I would like to use the flutter web build as a micro frontend which can be viewed in angular shell application…
ACR
  • 317
  • 1
  • 8
9
votes
3 answers

Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree

I'm working with the berry version of yarn with modules federation and vue3. When I run these commands to create the base of the project: mkdir vue-error yarn set version stable yarn plugin import workspace-tools yarn init -pw cd packages npx…
jics
  • 1,897
  • 3
  • 15
  • 24
9
votes
2 answers

Webpack 5 module federation missing chunk when dynamically loading remote module

I am trying to split a big monolith React app into micro-frontends using webpack module federation. I already have the remote module deployed and working great when running the dev server locally, everything works perfectly fine. But after running…
9
votes
2 answers

How does module federation choose which dependency version to use?

I've been playing around with this module federation example, where the setup is relatively straightforward - a host is consuming a module from a remote with a shared react dependency. When running this locally, I noticed that despite both host and…
Niko Savas
  • 93
  • 1
  • 5
1
2 3
30 31