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

239
Visualizações
Module Federation Two Way Sharing Invalid Token

I'm attempting to pull a remote into module shared over module federation but am getting an error when consuming the exposed module, Uncaught SyntaxError: Unexpected token ':'

The module being pulled as the remote:

module.exports = {
experiments: {
outputModule: true
},
plugins: [new ModuleFederationPlugin({

// For remotes (please adjust)
name: "angularRouter",
remoteType: "module",
filename: "remoteEntry.js",
exposes: {
  "./Router": "./src/bootstrap.ts",
},
shared: {
  "@angular/common": { singleton: true, requiredVersion: deps['@angular/common'], eager: false },
  "angular/core": { singleton: true, requiredVersion: deps['@angular/core'], eager: false},
  "@angular/router": { singleton: true, requiredVersion: deps['@angular/router'], eager: false}
}
})]

I've tried remoteType script and module and library: { type: "var", name: "angularRouter"},

The module that consumes the first and then is exposed

plugins: [
      new ModuleFederationPlugin({
        
          // For remotes (please adjust)
          
          name: "mfe4",
          library: { type: "var", name: "mfe4" },
          filename: "remoteEntry.js",
          exposes: {
              './web-components': './app.js',
          },        
          remotes: {
            angularRouter: "http://localhost:4206/remoteEntry.js"
          },
          shared: ["react", "react-dom"]
        })
    ]

I've tried this with angularRouter: "http://localhost:4206/remoteEntry.js" and angularRouter: "angularRouter@http://localhost:4206/remoteEntry.js"

No matter what I do I get the following output in the generated remoteEntry file

module.exports = http://localhost:4206/remoteEntry.js;

Is there a way to get the first exposed module to be consumed as a remote and forwarded properly into the second remoteEntry file?

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