browserslist/browserslist-useragent-regexp

`minor.push` is not a function

fdubost opened this issue · 7 comments

Hi,

I'm facing an similar issue than #409 but with minor

TypeError: minor.push is not a function
     at versionsListToRanges (/Users/fdubost/Workspaces/my_project/node_modules/browserslist-useragent-regexp/lib/index.js:1177:17)
     at browsers.forEach (/Users/fdubost/Workspaces/my_project/node_modules/browserslist-useragent-regexp/lib/index.js:1212:24)
     at Map.forEach (<anonymous>)
     at browserVersionsToRanges (/Users/fdubost/Workspaces/my_project/node_modules/browserslist-useragent-regexp/lib/index.js:1211:12)
     at getUserAgentRegExps (/Users/fdubost/Workspaces/my_project/node_modules/browserslist-useragent-regexp/lib/index.js:1511:26)
     at getUserAgentRegExp (/Users/fdubost/Workspaces/my_project/node_modules/browserslist-useragent-regexp/lib/index.js:1525:19)

I'm using:

  • node 10.17.0
  • yarn 1.12.3
  • browsersist-useragent-regexp last version (2.0.2)
  • the browsers configuration is ['Safari < 11']

Thank you!

Don't know if this is linked, but the regexp doesn't match IE11 user agent Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko with:

[
  ie <= 11,
  'Safari > 8 and Safari < 11'
]

But it matches with:

[
  ie <= 11,
  'Safari 9',
  'Safari 10'
]

@fdubost About your second message:

> browserslist "ie <= 11, Safari > 8 and Safari < 11"
safari 10.1
safari 10
safari 9.1
safari 9

This is problem of Browserslist itself. You can create issue about that in Browserslist repo.

As workaround you can use Safari > 8 and Safari < 12, ie <= 11

> browserslist "Safari > 8 and Safari < 12, ie <= 11"
ie 11
ie 10
ie 9
ie 8
ie 7
ie 6
ie 5.5
safari 11.1
safari 11
safari 10.1
safari 10
safari 9.1
safari 9

@fdubost

v2.0.3

I hope what finally fixed this bug.

Thank you @dangreen ! The error is fixed but I still have an issue: [ Safari < 11 ] catches this user-agent which is a Chrome 80
Mozilla/5.0 (Linux; Android 8.0.0; Bouygtel4K Build/CALIFORNIE; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.162 Mobile Safari/537.36

It seems to work, thank you 🙏 !