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

Error using 8.0.0 with Stylelint 16.1.0

Open ateufel opened this issue 7 months ago • 5 comments

When i try to use this combination of versions, I get the following error when trying to lint my CSS:

Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/stylelint-no-unsupported-browser-features/lib/index.js from .../node_modules/stylelint/lib/augmentConfig.js not supported.
Instead change the require of index.js in .../node_modules/stylelint/lib/augmentConfig.js to a dynamic import() which is available in all CommonJS modules.

The error appears to happen in Line 334 of augmentConfig.js, when it tries to require the plugin, which seems to be an ESM. I cleared my node_modules folder and rebuilt it with yarn, but it did not solve the issue. Does it work for anyone with those versions?

ateufel avatar Jan 10 '24 12:01 ateufel

so far I haven't been able to reproduce this with stylelint 16, but that's the expected behavior if you use version 8 with stylelint 15.

could you provide a minimal reproduction of the issue to debug?

RJWadley avatar Jan 25 '24 16:01 RJWadley

Version 7.0.0 works well with stylelint 15, but 7.1.0 doesn't work. Same "ERR_REQUIRE_ESM" error.

xsq007 avatar May 14 '24 13:05 xsq007

@xsq007 from NPM: version 7.1 is the same as 8.0, and was incorrectly published under the wrong version

so yeah, don't use that version. my apologies for that! use 7.0.0 or 8+

RJWadley avatar May 16 '24 20:05 RJWadley

try to use .mjs and esm syntax for your config it works for me

budarin avatar May 17 '24 01:05 budarin

try to use .mjs and esm syntax for your config it works for me

Didn't help me unfortunately - switched to mjs and ESM but it's still the same error.

certainlyakey avatar Jun 17 '24 10:06 certainlyakey