Circular dependencies detection do not exclude tests in buildable libraries
See original GitHub issueCurrent Behavior
I can’t build a buildable library because NX is detecting wrong circular dependecies.
I have two buildable libraries in a project, the first library creates a value object to make a date inmutable, the second library generates random instance of the first library (for test purpouses).
I write a test for the first library, in this test, I import the second library and the tests works properly but if I try to build the application I get a circular dependency error.
However, if I build the library using the command npx tsc --project libs\shared\domain\timestamp\tsconfig.lib.json
the library builds without no problem and no circular dependencies.
This is the current dep graph of the application:
I think the problem comes from the dependency detection, he should ignore the test files.
Expected Behavior
I should be able to build the library without a circular dependency error.
Steps to Reproduce
I have created a repo with the example https://github.com/abrahamsaanchez/circular-dependencies
Failure Logs
> NX Could not execute shared/domain/timestamp:build because it has a circular dependency
Environment
> NX Report complete - copy this into the issue template
Node : 16.13.2
OS : win32 x64
npm : 8.4.1
nx : 13.9.5
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 13.9.5
@nrwl/eslint-plugin-nx : 13.9.5
@nrwl/express : Not Found
@nrwl/jest : 13.9.5
@nrwl/js : 13.9.5
@nrwl/linter : 13.9.5
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : 13.9.5
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 13.9.5
typescript : 4.5.5
rxjs : 6.6.7
---------------------------------------
Community plugins:
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5
Found a solution, you can use the implicitDependencies configuration to ignore dependencies.
https://github.com/nrwl/nx/issues/10290#issuecomment-1126635073
Up this