Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
remoteEntry.js was not being fetched despite being defined?

Please find below the webpack.config.js for host/container

plugins: [
    new ModuleFederationPlugin({
      name: "host",
      remotes: {
        subA: "sub_a@http://localhost:8081/remoteEntry.js",
        subB: "sub_b@http://localhost:8082/remoteEntry.js",
      },
    }),
    new HtmlWebpackPlugin({
      template: "./public/index.html",
    }),
  ],

As shown above, I've defined subA & subB to be remote dependencies and I would expect once host being loaded, http://localhost:8081/remoteEntry.js & http://localhost:8082/remoteEntry.js both being fetched but this is not the case

enter image description here

Observation

My guess is, the above could be due to at host level, I did not import source code from subA and hence Webpack is smart enough not to fetch remoteEntry.js, and if I import source code from subA, it works fine, I can see http://localhost:8081/remoteEntry.js being fetched.

However, I don't believe my guess was correct.

On host level, I've import source code from subA, and I did not import source code from subB, however http://localhost:8082/remoteEntry.js will be fetched as well enter image description here

The image above showing that both remoteEntry.js from subA and subB are being fetched by host, despite I did not import any source code from subB, the behaviour looks to me like Webpack either avoid the entire remotes plugin at host level, or if any of the remote dependencies being needed, remoteEntry.js will be fetched altogether?

I'm actually expecting host application will actually fetch all remoteEntry.js that are being defined at remotes, despite whether the source code is being used or not

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda