'nx dep-graph not showing any relations

I have this Angular/NestJS monorepo powered by NX, and I decided to make better use of NX by organising more stuff into libs, but before I do so, I want to make sure everything is correctly set up so far. The frontend and backend apps share a lib which contains interfaces. They both import from this lib. However, when I run nx dep-graph, I just see the frontend, api and shared nodes without any connecting lines between them. What could be the cause of this?

I understand that there may be some context missing in order to be able to correctly analyse the problem, but I don't know exactly what to share, since there is so much relevant code/config, so please let me know what you need, and I'll add it in this question.



Solution 1:[1]

I have the same problem. A temporary solution I found is to open all modules where you import anything from as a typescript alias. After opening, the graph changes and shows the connection

According to Nx docs:

Nx creates a graph of all the dependencies between projects in your workspace using two sources of information:

  1. Typescript import statements referencing a particular project's path alias
  2. Manually created implicitDependencies in the nx.json file.

I guess these typescript import statements are not recognized until they

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Patrik Szabó