inline-style-prefixer icon indicating copy to clipboard operation
inline-style-prefixer copied to clipboard

The version above 4.21 of browserslist does not include IE by default and it causes error

Open edwardfxiao opened this issue 2 years ago • 0 comments

Recently browserslist removed IE 11 from defaults in 4.21, which causes var _browserslist = require("browserslist") in caniuse-api does not include IE by default at all.

Therefore versions['ie'] is undefined, and versions['ie'].x reports error.

The older version of browserslist contains ie

if (versions[browser].x >= browserList[browser]) {

//TypeError: Cannot read properties of undefined (reading 'x')
// console.log(versions) ->
{
  and_chr: { y: 103 },
  and_ff: { y: 101 },
  and_qq: { y: 10.4 },
  and_uc: { y: 12.12 },
  android: { y: 2.1, x: 2.1 },
  chrome: { y: 4, x: 4 },
  edge: { y: 12 },
  firefox: { a: 2, x: 3.6, y: 3 },
  ios_saf: { y: 3.2, x: 3.2 },
  kaios: { y: 2.5 },
  op_mini: {},
  op_mob: { n: 10, y: 11 },
  opera: { n: 10, y: 10.5 },
  safari: { y: 3.1, x: 4 },
  samsung: { y: 4 }
}
// console.log(keyword) -> 
border-radius

// console.log(_caniuseApi.getSupport(keyword)) ->
{
  and_chr: { y: 103 },
  and_ff: { y: 101 },
  and_qq: { y: 10.4 },
  and_uc: { y: 12.12 },
  android: { y: 2.1, x: 2.1 },
  chrome: { y: 4, x: 4 },
  edge: { y: 12 },
  firefox: { a: 2, x: 3.6, y: 3 },
  ios_saf: { y: 3.2, x: 3.2 },
  kaios: { y: 2.5 },
  op_mini: {},
  op_mob: { n: 10, y: 11 },
  opera: { n: 10, y: 10.5 },
  safari: { y: 3.1, x: 4 },
  samsung: { y: 4 }
}

// console.log(browser) ->
ie

edwardfxiao avatar Jul 12 '22 02:07 edwardfxiao