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

Breaks when browserslist includes unreleased Safari versions #38

Closed
sgomes opened this issue Feb 15, 2019 · 3 comments · May be fixed by #46
Closed

Breaks when browserslist includes unreleased Safari versions #38

sgomes opened this issue Feb 15, 2019 · 3 comments · May be fixed by #46

Comments

@sgomes
Copy link

sgomes commented Feb 15, 2019

On a browserslist that includes unreleased Safari versions, the library seems to break when accessed with any Safari version (not just Safari TP), presumably because it's being compared against the browserslist versions.

TypeError: Invalid Version: TP.0.0
    at new SemVer (/devpath/wp-calypso/node_modules/semver/semver.js:312:11)
    at compare (/devpath/wp-calypso/node_modules/semver/semver.js:585:39)
    at Function.gte (/devpath/wp-calypso/node_modules/semver/semver.js:634:10)
    at compareBrowserSemvers (/devpath/wp-calypso/node_modules/browserslist-useragent/lib/index.js:182:19)
    at /devpath/wp-calypso/node_modules/browserslist-useragent/lib/index.js:208:93
    at Array.some (<anonymous>)
    at matchesUA (/devpath/wp-calypso/node_modules/browserslist-useragent/lib/index.js:207:25)

The issue appears to be the non-numeric nature of Safari TP's version "numbering", possibly when combined with the following browserslist-useragent flags: ignorePatch: true, ignoreMinor: true, allowHigherVersions: true.

@sheerun
Copy link
Contributor

sheerun commented Mar 7, 2019

yup, the same issue

@florisvink
Copy link

florisvink commented Apr 10, 2019

The problem comes form the underlying caniuse-db module which uses TP (Technology Preview) as a version part. When you have unreleased versions in your browserlist query it lists safari TP and 'TP' cannot be compared by Semver because it's not an integer.

@nathggns
Copy link

nathggns commented Apr 2, 2020

same issue!

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

Successfully merging a pull request may close this issue.

4 participants