rschristian / deptree

Visualize the dependency tree of a package or project
https://deptree.rschristian.dev
MIT License
17 stars 2 forks source link

module.pkg undefined throws Cannot read properties of undefined (reading 'dependencies') #7

Closed VandeurenGlenn closed 3 months ago

VandeurenGlenn commented 3 months ago

have multiple varint deps, only the first one works as expected, after that all fail to find the dist-tag

image

rschristian commented 3 months ago

have multiple varint deps, only the first one works as expected

I have absolutely no idea what this means.

Please provide your inputs.

VandeurenGlenn commented 3 months ago

@rschristian Cannot read properties of undefined (reading 'dependencies') is thrown when I upload https://github.com/leofcoin/monorepo/blob/main/packages/chain/package.json

image

As you can see from the screenshot below it finds the correct dist-tag the first time, but after that doesn't image

VandeurenGlenn commented 3 months ago

Think I know why, the dependency is a github dependency

image

the 'g' from github is missing

VandeurenGlenn commented 3 months ago

But on the other side, the created key will always be the same but yet never is a cached module used.

rschristian commented 3 months ago

But on the other side, the created key will always be the same but yet never is a cached module used.

I don't know why you think this is, the cache is very clearly used. As it looks like you've inserted your own logs, they're likely set up incorrectly.

Think I know why, the dependency is a github dependency

GitHub deps will not be supported.

VandeurenGlenn commented 3 months ago

@rschristian Indeed, cache works, would have been weird if it really doesn't because a simple map.

GitHub deps will not be supported.

Oh damn, why is that? I just added initial support https://github.com/rschristian/deptree/compare/master...VandeurenGlenn:deptree:master

rschristian commented 3 months ago

Because GitHub dependencies are a really, really bad idea with the current Node package managers. They are not at all equipped to use GH dependencies safely and the use should be heavily discouraged (if not removed outright).

You're referencing code that could change at any point in time without any guarantees of owner. Don't do it.

VandeurenGlenn commented 3 months ago

Aha, I see, makes sense!