Nonnumeric browser versions + allowHigherVersions causes all versions to be in the range
See original GitHub issueHey!
We’ve discovered an interesting issue.
When we use unreleased versions
in our .browserslistrc
with allowHigherVersions
in the browserslist-useragent-regexp
setting, the result regex matches all versions of Safari.
After some debugging, we found out that having unreleased versions
in .browserslistrc
results in having Safari TP
among Safari versions. Which can’t be handled by the semverify function. There’s even a comment says “risky” there 😅
Anyway, “Safari TP” turns into 0.0.0
, which, with the allowHigherVersions
flag, makes the whole browserslist setting useless — the result regex included everything that’s greater than 0.
This is the result regex:
(Version\/(0|([1-9]|\d{2,})|12|(1[3-9]|[2-9]\d|\d{3,})|13|(1[4-9]|[2-9]\d|\d{3,})|14|(1[5-9]|[2-9]\d|\d{3,})|15|(1[6-9]|[2-9]\d|\d{3,}))\.\d+(?:\.\d+)? Safari\/)
instead of awaited
(Version\/(12|(1[3-9]|[2-9]\d|\d{3,})|13|(1[4-9]|[2-9]\d|\d{3,})|14|(1[5-9]|[2-9]\d|\d{3,})|15|(1[6-9]|[2-9]\d|\d{3,}))\.\d+(?:\.\d+)? Safari\/)
.
Data for debugging:
.browserslistrc
for testing:
unreleased versions
last 2 years
last 3 major versions
not dead
not ie <= 11
not ie_mob <= 11
Version of browserslist-useragent-regexp
— 3.0.0
Version of node
— 14.17
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
@rayproud-pp Hi! Yes, I will get it soon.
@rayproud-pp Hi. Did you test fix?