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

286
Visualizações
Is there an way to import an nx-library module in another nx-library module?

My project is based on nx-workpsace and i am having 1 project in apps and 2 libraries in my libs folder.

The structure looks like this:

+-- apps
|   +-- main-application
+-- libs
|   +-- lib-1 (feature-library)
|   +-- lib-2 (shared-components-library)

I am importing the lib-1 in my main-application like this:

imports: [
  lib1Module.forRoot()
]

If i now try to import the lib1Module in my lib2Module like this

imports: [
  lib1Module
]

Im getting the following error: Uncaught TypeError: Cannot read properties of undefined (reading 'lib1Module')

I think the error is the forRoot() in the main application but i don't know how to fix this, because i need to provide the lib-1 services in the main-application. The reason why i need the lib1Module in my lib2Module is that i use an directive of lib-1 in lib-2.

Info

If I remove the forRoot() it still doesnt work. Is there a way to import an module in an nx-library from another nx-library?

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