Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using 8.0.0 with Stylelint 16.1.0 #297

Open
ateufel opened this issue Jan 10, 2024 · 5 comments
Open

Error using 8.0.0 with Stylelint 16.1.0 #297

ateufel opened this issue Jan 10, 2024 · 5 comments

Comments

@ateufel
Copy link

ateufel commented Jan 10, 2024

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?

@RJWadley
Copy link
Owner

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?

@xsq007
Copy link

xsq007 commented May 14, 2024

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

@RJWadley
Copy link
Owner

@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+

@budarin
Copy link

budarin commented May 17, 2024

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

@certainlyakey
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants