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

Stylelint v16 Breaks Plugin in Webpack #342

Closed
goxmedia opened this issue Dec 10, 2023 · 8 comments · Fixed by #346
Closed

Stylelint v16 Breaks Plugin in Webpack #342

goxmedia opened this issue Dec 10, 2023 · 8 comments · Fixed by #346

Comments

@goxmedia
Copy link

goxmedia commented Dec 10, 2023

Actual Behavior

Upgraded to Stylelint v.16. Upon build, received the following error:

The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16 [webpack-cli] HookWebpackError: formatter is not a function

Expected Behavior

Build should have completed as typical and as currenty confitured through .styelintrc.js.

How Do We Reproduce?

Upgrade package.json to use Styleline v16.0.1. Run build.

Please paste the results of npx webpack-cli info here, and mention other relevant information

System: OS: macOS 14.1.2 CPU: (20) arm64 Apple M1 Ultra Memory: 69.48 GB / 128.00 GB Binaries: Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node Yarn: 1.22.19 - ~/Sites/themes/ghost/os-ghost/node_modules/.bin/yarn npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm Browsers: Chrome: 120.0.6099.71 Safari: 17.1.2 Packages: babel-loader: ^9.1.3 => 9.1.3 browser-sync-webpack-plugin: ^2.3.0 => 2.3.0 copy-webpack-plugin: ^11.0.0 => 11.0.0 css-loader: ^6.8.1 => 6.8.1 css-minimizer-webpack-plugin: ^5.0.1 => 5.0.1 eslint-webpack-plugin: ^4.0.1 => 4.0.1 image-minimizer-webpack-plugin: ^3.8.3 => 3.8.3 postcss-loader: ^7.3.3 => 7.3.3 stylelint-webpack-plugin: ^4.1.1 => 4.1.1 svgo-loader: ^4.0.0 => 4.0.0 ts-loader: ^9.5.1 => 9.5.1 webpack: ^5.89.0 => 5.89.0 webpack-bundle-analyzer: ^4.10.1 => 4.10.1 webpack-cli: ^5.1.4 => 5.1.4 webpack-messages: ^2.0.4 => 2.0.4 webpackbar: ^5.0.2 => 5.0.2

@evenstensberg
Copy link
Member

Provide a reproduction repo please

@alexander-akait
Copy link
Member

I think we don't support stylelint v16 right now. You can send a PR and help us, thank you

/cc @ricardogobbosouza do you have time to help us?

@ricardogobbosouza
Copy link
Collaborator

@alexander-akait Of course, I will do

@ricardogobbosouza
Copy link
Collaborator

ricardogobbosouza commented Dec 13, 2023

I was analyzing and saw that stylelint was rewritten in ESM
@alexander-akait Does webpack support plugins ESM?

@goxmedia
Copy link
Author

Thanks for the help. I had to disable it for now in my Webpack config and will use the VSC plugin for now.

@chadlwilson
Copy link

Interestingly (and this is probably unhelpful to most folks here), the older plugin version 2.5.0 seems to be working OK with stylelint 16 on webpack 4, despite it complaining about the peer dependency and stylelint complaining The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16.

@alexander-akait
Copy link
Member

@ricardogobbosouza You can use dynamic import(...) to load ESM version, we use it in many plugins

@alexander-akait
Copy link
Member

But yeah webpack supports ESM configurations, but I prefer above right now

dgdavid added a commit to agama-project/agama that referenced this issue Jan 10, 2024
This reverts commit fea81f1 because
stylelint-webpack-plugin does not work with the latest stylelint v16 yet.

See webpack-contrib/stylelint-webpack-plugin#342
dgdavid added a commit to agama-project/agama that referenced this issue Jan 10, 2024
Update web dependencies to their latest versions via `npm update` and
`npm install package-name@latest` when needed.

It does not update `stylelint` dev dependencies because
`stylelint-webpack-plugin` [does not work with the latest stylelint v16
yet](webpack-contrib/stylelint-webpack-plugin#342).
We can wait for getting linters up-to-date.
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

Successfully merging a pull request may close this issue.

5 participants