hi all I m having issues…

less than 1 minute read

hi all I’m having issues with paths in http://tsconfig.app|tsconfig.app: tslint throws circular dependency error: ERROR: 5:1 nx-enforce-module-boundaries Circular dependency between "shared" and "my-app" detected

this is tsconfig.app.json "baseUrl": "src", "paths": { "@modules/*": ["app/modules/*"], "@common/*": ["app/common/*"], ... "@workspace/ng-kit/*": ["../../../libs/ng-kit/src/lib/*"], "@workspace/shared/*": ["../../../libs/shared/src/lib/*"], root tsconfig "baseUrl": ".", "paths": { "@modules/*": ["apps/my-app/src/app/modules/*"], "@common/*": ["apps/my-app/src/app/common/*"], "@ethic/ng-kit/*": ["libs/ng-kit/src/lib/*"], "@ethic/shared/*": ["libs/shared/src/lib/*"], }, my fix: error disappeared after removing “paths” sections from tsconfig.app.json and listing everything in the root config. but in this case I don’t have separation of aliases between applications: basically I can import stuff from one app into another. and also I have to rewrite some imports in my app since baseUrl is no longer src - after moving paths to root tsconfig I need to use baseUrl: '.'

please, point me to the right direction. should I have all paths sitting in the root tsconfig or can I have separate paths for each app? thanks

P.S. also there were cases when application was built fine without any errors but webstorm IDE highlighted imports using aliases with red

Responses:

This is similar to: https://nrwlcommunity.slack.com/archives/CMFKWPU6Q/p1592563854477400?thread_ts=1592206491.326000&cid=CMFKWPU6Q

so the idea is to put paths only in root tsconfig, right?

apps shouldn’t be exporting modules

Updated: