bmatcuk / stylelint-lsp

A stylelint Language Server
MIT License
48 stars 4 forks source link

Issue with "no unsupported browser" stylelint plugin #35

Closed chrisgrieser closed 10 months ago

chrisgrieser commented 2 years ago

I am using nvim's built-in lsp and at first, the stylelint-lsp didn't do anything.

Looking into the :LSPLog, I found this (rather long) error, which indicated that there was some issue with the stylelint-no-unsupported-browser-features plugin.

[ERROR][2022-10-10 16:37:31] .../vim/lsp/rpc.lua:733    "rpc"   "stylelint-lsp" "stderr"    "Error when trying to validate file:///Users/chrisgrieser/Main%20Vault/.obsidian/themes/Shimmering%20Focus/theme.css TypeError: opts.node.rangeBy is not a function\n    at new Warning (/opt/homebrew/lib/node_modules/postcss/lib/warning.js:9:29)\n    at Result.warn (/opt/homebrew/lib/node_modules/postcss/lib/result.js:26:19)\n    at /opt/homebrew/lib/node_modules/stylelint-no-unsupported-browser-features/node_modules/doiuse/lib/doiuse.js:65:16\n    at Detector.decl (/opt/homebrew/lib/node_modules/stylelint-no-unsupported-browser-features/node_modules/doiuse/lib/detect-feature-use.js:70:11)\n    at /opt/homebrew/lib/node_modules/stylelint-no-unsupported-browser-features/node_modules/doiuse/lib/detect-feature-use.js:155:16\n    at Rule.each (/Users/chrisgrieser/.local/share/nvim/mason/packages/stylelint-lsp/node_modules/stylelint-lsp/node_modules/postcss/lib/container.js:105:16)\n    at Detector.node (/opt/homebrew/lib/node_modules/stylelint-no-unsupported-browser-features/node_modules/doiuse/lib/detect-feature-use.js:148:10)\n    at Detector.rule (/opt/homebrew/lib/node_modules/stylelint-no-unsupported-browser-features/node_modules/doiuse/lib/detect-feature-use.js:90:10)\n    at /opt/homebrew/lib/node_modules/stylelint-no-unsupported-browser-features/node_modules/doiuse/lib/detect-feature-use.js:151:16\n    at Root.each (/Users/chrisgrieser/.local/share/nvim/mason/packages/stylelint-lsp/node_modules/stylelint-lsp/node_modules/postcss/lib/container.js:105:16)\n"

removing the references to the plugin in my stylelintrc fixed the issue and the stylelint-lsp works.

I tested running stylelint in the terminal together with the "unsupported browser features" plugin, and it does work fine there


stylelint is installed in the very same directory as the unsupported-browser-feature plugin, so I assume the issue is not about PATH or something?

Pasted image 2022-10-10 16 51 21
bmatcuk commented 11 months ago

Again, sorry I never got back to you on these two tickets... I wonder if stylelint-lsp was loading the wrong version of stylelint or one of the dependencies... maybe some kind of version mismatch somewhere... 🤔

chrisgrieser commented 10 months ago

hmmm, by now, I don't even use that plugin anymore, so it's kinda obsolete. The other plugins all do work though, so again, I guess I'm gonna close this issue until any issue re-occurs.