Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda