Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

281
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda