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

Default install timeout of 30s is too strict #623

Open
transitive-bullshit opened this issue Apr 1, 2022 · 0 comments
Open

Default install timeout of 30s is too strict #623

transitive-bullshit opened this issue Apr 1, 2022 · 0 comments

Comments

@transitive-bullshit
Copy link

transitive-bullshit commented Apr 1, 2022

Up front, I just want to say that I ❤️ Bundlephobia.

Context

As a library author, I keep getting sporadic build errors with https://bundlephobia.com/package/[email protected], and then I noticed that there are dozens of similar issues in this repo.

So I got bundlephobia running locally, and realized that 95% of these sporadic build errors are caused by the timeout being way too aggressive when trying to install the package(s).

For instance, locally this takes anywhere from 24s to 40s:

npm install [email protected]  --cache=/tmp/tmp-build/cache --no-package-lock --no-shrinkwrap --no-optional --no-bin-links --ignore-scripts --save-exact --production --json

^ this command is generated from the accompanying project's worker in package-build-stats.

So even locally with a 1GB connection and no additional traffic, this timeout fails about 50% of the time. If the package can't install, then getAllPackageExports and getPackageExportSizes can't run.

Please describe the feature/suggestion

Increase the default getPackageStats timeout from 30s to 120s.

This PR #596 by @n10l appears to already solve the issue.

As far as I can tell looking through the existing issues in this repo, this timeout is affecting dozens of mid-to-large-sized NPM packages. Since it's a relatively straightforward fix, I'm hoping the upsides outweigh any potential downsides.

Note: if this fix is implemented, we may need to update the API timeout(s) in a few other places of the codebase. Happy to submit a subsequent PR in this case.

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

No branches or pull requests

1 participant