I am trying to understan…

1 minute read

I am trying to understand why nx dep-graph in my project is not properly showing dependencies. I don’t know if I’m missing configuration, if I’m doing something unconventional, or if I am a unicorn. Any help would be appreciated. I am only referencing internal project dependencies, not external dependencies.

Responses:

how are you importing your libs?

ex: import { ServiceConfig } from ’@cosmos/common’;

have you added a reference to ServiceConfig in the libs index.ts?

export * from './lib/somelibname'

yes, but I do make use of barrels. so for example, I might do export * from ‘./lib/types’ and in lib/types/index.ts it would export * from ‘./service-config’

I mean, the application itself works, but I am not getting deps

if my imports were messed up, I would assume the app would be broken

you dont need to have .ts in your barrel files

right, I don’t

does you lib have an entry in nx.json, tsconfig.json and your angular.json file?

yeap

though I have not used tags yet

do I need to define tags?

nope tags will not matter

try editting your service-config lib and run yarn affected:test --base=whateverbase and see if your lib is affected? dep graph uses affected to render the graph

think I figure it out

does dep-graph depend on npmScope to filter out external libs?

in my own libs, I have multiple “scopes” if you will… for example, I created @a/common @b/common instead of @npmScope/a/common and @npmScope/b/common

looks like this breaks dep-graph

so, someone else on the project says it works on mac…

my guess it there is a path separator bug…

will try to debug it

Does dep-graph always use affected, even when running nx dep-graph?

I don’t think it does.

Ok, I found the path separator bug

someone at nrwl needs to develop on windows :smile:

Did you try cmd or power Shell?

cmd

Updated: