Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
Módulo Federación Bidireccional Compartir Token no válido

Estoy intentando llevar un control remoto a un módulo compartido a través de la federación de módulos, pero recibo un error al consumir el módulo expuesto, Uncaught SyntaxError: Unexpected token ':'

El módulo que se extrae como control remoto:

 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} } })]

Probé el script, el módulo y la biblioteca de remoteType: { tipo: "var", nombre: "angularRouter"},

El módulo que consume el primero y luego se expone

 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"] }) ]

Probé esto con angularRouter: "http://localhost:4206/remoteEntry.js" y angularRouter: "angularRouter@http://localhost:4206/remoteEntry.js"

No importa lo que haga, obtengo el siguiente resultado en el archivo de entrada remota generado

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

¿Hay alguna manera de hacer que el primer módulo expuesto se consuma como un control remoto y se reenvíe correctamente al segundo archivo de entrada remota?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!