RJWadley / stylelint-no-unsupported-browser-features

Disallow features that aren't supported by your target browser audience.
422 stars 21 forks source link

Cannot read properties of undefined (reading 'B') after update library caniuse-lite to 1.0.30001655 version #299

Open MrVladevoit opened 2 weeks ago

MrVladevoit commented 2 weeks ago

We started getting errors after updating the library caniuse-lite from 1.0.30001653 to 1.0.30001655. It happened because caniuse-db deleted some information, which was used by stylelint-no-unsupported-browser-features

TypeError: Cannot read properties of undefined (reading 'B') at Module.unpackFeature (my-project/node_modules/.pnpm/caniuse-lite@1.0.30001655/node_modules/caniuse-lite/dist/unpacker/feature.js:31:29) at BrowserSelection.compileBrowserSupport (file://my-project/node_modules/.pnpm/doiuse@6.0.2/node_modules/doiuse/lib/BrowserSelection.js:148:35) at BrowserSelection.missingSupport (file://my-project/node_modules/.pnpm/doiuse@6.0.2/node_modules/doiuse/lib/BrowserSelection.js:178:27) at DoIUse.postcss (file://my-project/node_modules/.pnpm/doiuse@6.0.2/node_modules/doiuse/lib/DoIUse.js:67:43) at file://my-project/node_modules/.pnpm/stylelint-no-unsupported-browser-features@8.0.1_stylelint@16.8.1/node_modules/stylelint-no-unsupported-browser-features/lib/index.js:99:27 at file://my-project/node_modules/.pnpm/stylelint@16.8.1_typescript@5.5.4/node_modules/stylelint/lib/lintPostcssResult.mjs:112:8 at Array.map () at lintPostcssResult (file://my-project/node_modules/.pnpm/stylelint@16.8.1_typescript@5.5.4/node_modules/stylelint/lib/lintPostcssResult.mjs:102:18) at async lintSource (file://my-project/node_modules/.pnpm/stylelint@16.8.1_typescript@5.5.4/node_modules/stylelint/lib/lintSource.mjs:108:2) at async file://my-project/node_modules/.pnpm/stylelint@16.8.1_typescript@5.5.4/node_modules/stylelint/lib/standalone.mjs:236:27

ai commented 2 weeks ago

Can I Use deleted css-scroll-timeline https://github.com/Fyrd/caniuse/commit/0a84cfd3b2b3abb650787abdc39faf382800e8cd

MrVladevoit commented 2 weeks ago

@ai , thank you for the help and support 🙌

AlexWayfer commented 2 weeks ago

I'm proposing to delete it in doiuse, our dependency: https://github.com/anandthakker/doiuse/pull/191

MuTsunTsai commented 1 week ago

@zhangqiankunai My current workaround is to lock the version of caniuse-lite like this (say you're using PNPM) in package.json:

{
    "pnpm": {
        "overrides": {
            "caniuse-lite": "1.0.30001653"
        },
    }
}