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

171
Visualizações
MFE angular to share npm package Nx

Trying to share external npm library among MFE application using "@nrwl/angular": "^14.4.0",

created a base module-federation.config.js and added the library

const coreLibraries = new Set([
  '@ckeditor/ckeditor5-build-classic',
  '@ckeditor/ckeditor5-angular',
]);
module.exports = {
  shared: (libraryName, defaultConfig) => {
    if (coreLibraries.has(libraryName)) {
      console.log(libraryName); // The library never occurs here
      return defaultConfig;
    }
    return false;
  },
};

In the coreLibraries.has(libraryName) condition the library is not present and hence facing the exception as

ERROR Error: Uncaught (in promise): CKEditorError: ckeditor-duplicated-modules
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-ckeditor-duplicated-modules
CKEditorError: ckeditor-duplicated-modules
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-ckeditor-duplicated-modules
    at ckeditor.js:6:316950
    at ckeditor.js:6:315303
    at ckeditor.js:6:217
    at ckeditor.js:6:80
    at 9949 (ckeditor.js:6:1)
    at __webpack_require__ (bootstrap:19:1)
    at 8210 (core.mjs:1831:1)
    at __webpack_require__ (bootstrap:19:1)
    at 373 (entry.component.html:7:63)
    at __webpack_require__ (bootstrap:19:1)
    at resolvePromise (zone.js:1211:31)
    at resolvePromise (zone.js:1165:17)
    at zone.js:1278:17
    at _ZoneDelegate.invokeTask (zone.js:406:31)
    at Object.onInvokeTask (core.mjs:26510:33)
    at _ZoneDelegate.invokeTask (zone.js:405:60)
    at Zone.runTask (zone.js:178:47)
    at drainMicroTaskQueue (zone.js:585:35) 

The issue occurred because in other mfe the module is included multiple times

In the package.json I have the below dependencies

"dependencies": {
    "@ckeditor/ckeditor5-angular": "^4.0.0",
    "@ckeditor/ckeditor5-build-classic": "^34.2.0"
}

During the build, there is no logs on the console, because @ckeditor/ckeditor5-angular is not present.

How do we shared npm libraries in all mfs , it is suppose to be done by module-federation.config.js

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