ESLint throwing circular dependency issues (what feels) at random
See original GitHub issueCurrent Behavior
So I’ve been trying out nx the past few days and so far it looks very promising!
Now I’ve been playing around with different structures and the issue seems to be returning, so not sure whether it’s a bug or just me doing something wrong. It seems to be at random that ESLint is throwing circular dependencies:
Circular dependency between "api-core-feature" and "api" detected: api-core-feature -> api -> api-core-feature
Circular file chain:
- libs/api/core/feature/src/lib/api-core-feature.module.ts
- apps/api/src/app/app.module.ts (eslint@nrwl/nx/enforce-module-boundaries)
Often it also throws: imports of apps are forbidden (nx-enforce-module-boundaries)
, but these seem to go away automatically.
Everything works fine, running the linter also shows no issues, and neither does creating a build. I’ve no boundaries setup in ESLint and there are no tags added to the libs.
Expected Behavior
To only throw actual circular deps.
Steps to Reproduce
Keeps happening at random, but it’s mainly happening to the stuff I import in the ApiCoreFeatureModule
. Although, It’s also happened in other spots.
Environment
MacOS on both VSCode and WebStorm.
node 16.13.1 npm 8.1.2
"@nrwl/angular": "13.4.1",
"@nrwl/cli": "13.4.1",
"@nrwl/cypress": "13.4.1",
"@nrwl/eslint-plugin-nx": "13.4.1",
"@nrwl/jest": "13.4.1",
"@nrwl/linter": "13.4.1",
"@nrwl/nest": "^13.4.1",
"@nrwl/node": "13.4.1",
"@nrwl/tao": "13.4.1",
"@nrwl/workspace": "13.4.1"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:12 (3 by maintainers)
I have the same issue. My IDE is VS Code. Apparently it’s a cache issue as mentioned by @demisx . My workaround is to force linting across entire monorepo
and then just to restart IDE.
@BOBRIWE I will look into this issue as soon as possible. Sorry for the delay.