Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace packages or packages from private repos produce a 'failed to fetch' #5

Open
spaceemotion opened this issue Jul 28, 2024 · 4 comments

Comments

@spaceemotion
Copy link

I wanted to run our package list through DepTree and had to remove packages within our monorepo workspace (makes sense that they don't exist), as well as the FontAwesome Pro and TipTap Pro licensed packages (since they require a different package registry).

I guess the best way would be to just exclude packages that cannot be found from the tree? Right now it errors out with a "failed to fetch" message.

@rschristian
Copy link
Owner

The NPM registry has misconfigured CORS for error responses for nearly a year which means I can't actually distinguish a network error from a 404. I've sent a few emails to them but there seems to be no one willing to get that corrected anytime soon.

For now, the onus will be on uploaders to correctly limit the packages they feed into the tool.

@spaceemotion
Copy link
Author

Ah, that is unfortunate. Is there a way to skip the package in question in case the request fails;? Does deptree always need every dependency, even if it can't be reached?

@rschristian
Copy link
Owner

Skipping dependencies due to unknown errors (be it 404 or network errors) would result in unpredictability -- you'd have absolutely no idea if you're looking at your full dep tree or not.

Once NPM addresses their CORS issue I can better address the 404-flow, but until then, my hands are tied.

@rschristian
Copy link
Owner

rschristian commented Aug 2, 2024

It looks like NPM has now fixed CORS for bare packages (non-existent) but namespaced packages (@non/existent) are still a no-go. Will follow up w/ them to see if they can get this across the line finally.

Edit: I've also revised the error messages a bit, message should hopefully be clearer at least.

Edit 2: NPM engineering has re-confirmed the bug, and re-added it to their todo list, but it's not a priority so who knows when they'll get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants