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

282
Views
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
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!