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

TypeError: Invalid Version: 0.4.0-alpha.01 #3293

Closed
sentry-io bot opened this issue Feb 13, 2021 · 4 comments
Closed

TypeError: Invalid Version: 0.4.0-alpha.01 #3293

sentry-io bot opened this issue Feb 13, 2021 · 4 comments
Labels
A-frontend 🐹 C-bug 🐞 Category: unintended, undesired behavior

Comments

@sentry-io
Copy link

sentry-io bot commented Feb 13, 2021

Sentry Issue: CRATES-IO-FRONTEND-P3

TypeError: Invalid Version: 0.4.0-alpha.01
  at c (addon-tree-output/~ember-css-modules/ext.js:2:1)
  at e.exports (addon-tree-output/~ember-css-modules/ext.js:2:1)
  at e.exports/< (addon-tree-output/~ember-css-modules/ext.js:2:1)
  at default (addon-tree-output/~ember-css-modules/ext.js:2:1)
  at chart (cargo/components/download-graph.js:173:1)
...
(18 additional frame(s) were not displayed)
@plaets
Copy link
Contributor

plaets commented Feb 14, 2021

I think this also is related to node-semver and its usage in the downloads chart, node-semver can throw exceptions with a similar error message. I was able to confirm that it throws this exact exception for this exact version string in my dev environment.
https://github.com/npm/node-semver/blob/093b40f8a7cb67946527b739fe8f8974c888e2a0/classes/semver.js#L38
If that's the case, this means it's technically solved by #3296 but also raises a question - how many crates now have a (somewhat) broken downloads chart?

@plaets
Copy link
Contributor

plaets commented Feb 14, 2021

Now that I think about it, it's weird that it throws for this version string, it has very similar version strings in its tests
https://github.com/npm/node-semver/blob/60880700d6cee8450e37f5ac31430d84587620f5/test/classes/semver.js#L104
Am I looking at the same package? Maybe the 0 after "alpha." is considered redundant?
Edit: seems like this could be the case,
npx semver 0.4.0-alpha.01 outputs nothing, npx semver 0.4.0-alpha.1 outputs the version string.
Again, not exactly an authority but https://jubianchi.github.io/semver-check/#/version/0.4.0-alpha.01 also does not behave correctly with this version string (although it uses the same package so its not a surprise)
image

@plaets
Copy link
Contributor

plaets commented Feb 14, 2021

https://semver.org/#spec-item-9

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version (...)
Numeric identifiers MUST NOT include leading zeroes

@Turbo87
Copy link
Member

Turbo87 commented Feb 14, 2021

I guess #2463 is also quite related to this issue 😅

I think this also is related to node-semver and its usage in the downloads chart

you're right, the stack traces at https://sentry.io/share/issue/7ca9c44b92364fba945187005edd358d/ all indicate that it originates from the DownloadGraph component. I guess #3296 solved it already too, so we should be able to close this issue.

@Turbo87 Turbo87 closed this as completed Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

No branches or pull requests

2 participants