stylelint-no-unsupported-browser-features icon indicating copy to clipboard operation
stylelint-no-unsupported-browser-features copied to clipboard

Crashes after upgrading deps

Open lpil opened this issue 2 years ago • 2 comments

Hello! We upgraded our deps today and got this crash

TypeError: opts.node.rangeBy is not a function
    at new Warning (/Users/louis/src/nomio/nomio/node_modules/stylelint-no-unsupported-browser-features/node_modules/postcss/lib/warning.js:9:29)
    at Result.warn (/Users/louis/src/nomio/nomio/node_modules/stylelint-no-unsupported-browser-features/node_modules/postcss/lib/result.js:26:19)
    at /Users/louis/src/nomio/nomio/node_modules/doiuse/lib/doiuse.js:65:16
    at Detector.decl (/Users/louis/src/nomio/nomio/node_modules/doiuse/lib/detect-feature-use.js:70:11)
    at /Users/louis/src/nomio/nomio/node_modules/doiuse/lib/detect-feature-use.js:155:16
    at Rule.each (/Users/louis/src/nomio/nomio/node_modules/postcss/lib/container.js:105:16)
    at Detector.node (/Users/louis/src/nomio/nomio/node_modules/doiuse/lib/detect-feature-use.js:148:10)
    at Detector.rule (/Users/louis/src/nomio/nomio/node_modules/doiuse/lib/detect-feature-use.js:90:10)
    at /Users/louis/src/nomio/nomio/node_modules/doiuse/lib/detect-feature-use.js:151:16
    at Rule.each (/Users/louis/src/nomio/nomio/node_modules/postcss/lib/container.js:105:16)

Is there something I could do to help you debug?

Thanks

lpil avatar Dec 06 '21 09:12 lpil

Hi @lpil, thanks for reporting this. I can reproduce it, but don't know what's causing it yet. I assume the unit tests didn't catch this as the installed deps are cached (though it's an assumption that the current unit tests would catch this).

The first thing to do would be to figure out where it broke to see what's causing it exactly. I see the original title had a version range, so assuming it broke inbetween those two versions a running git bisect on this repo would probably help narrow down where it broke.

I don't have a lot of time to look into this at the moment, but if you'd like to help out then if you could look into where it broke exactly that would be great! To simplify testing during the bisect you could see whether running a clean install and then this repo's unit tests can reproduce the bug. If that's the case then all you'd have to do to test is npm ci && npm test.

ismay avatar Dec 06 '21 17:12 ismay

I think this will end up being the issue that fixes this https://github.com/stylelint/stylelint/issues/5766

PxlBuzzard avatar Dec 07 '21 21:12 PxlBuzzard

As of stylelint 14.10.0 this should no longer be an issue.

  • See this PR for the stylelint fix: https://github.com/stylelint/stylelint/pull/6244
  • The (first) stylelint version that contains this fix https://github.com/stylelint/stylelint/releases/tag/14.10.0
  • The thread and explantory comment for the resolution: https://github.com/stylelint/stylelint/issues/5766#issuecomment-1207266094

I'll quote the fix here as well:

image

To summarize, this was a bug in stylelint. If you encounter it, update your local version of stylelint to 14.10.0 or above.

ismay avatar Sep 09 '22 14:09 ismay

All right, bear with me because I've been a bit busy and haven't had the time to really dig into this issue. I've gotten advice that's a little different than what I've recommended in the comment above. I've just published v5.0.4 which updates the postcss dep on this lib's side, as recommended here:

image

Could anyone who was running into this error verify whether this has resolved the matter for them? I'd appreciate that, thanks! If that hasn't completely resolved it we can look into it a little more.

ismay avatar Sep 13 '22 16:09 ismay