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

postcss-loader webpack config uses outdated options object #661

Open
fattslug opened this issue Jul 13, 2021 · 0 comments
Open

postcss-loader webpack config uses outdated options object #661

fattslug opened this issue Jul 13, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@fattslug
Copy link

fattslug commented Jul 13, 2021

This bug was discovered when attempting to use @storybook/addon-postcss with Storybook 6.3.
There are deprecation warnings that postcss will require addon-postcss to function in Storybook 7.

Describe the bug

The options object for postcss-loader changed in v4.0.

To Reproduce

OLD:

          {
            loader: 'postcss-loader',
            options: {
              sourceMap: true,
              plugins: (
                await getPostCssConfig({
                  useModules: false
                })
              ).plugins
            }

Expected behavior

NEW:

          {
            loader: 'postcss-loader',
            options: {
              sourceMap: true,
              postcssOptions: { // This property is now required
                plugins: (
                  await getPostCssConfig({
                    useModules: false
                  })
                ).plugins
              }
            }

Screenshots

Omitting this new postcssOptions property will result in the following error:
Screen Shot 2021-07-13 at 2 14 39 PM

Additional context

This error happens at build-time within the @design-systems/storybook plugin.
I have not explored further than that right now.
In the modify-webpack.js file, updating the postcss-loader to use the postcssOptions object will fully fix this issue.
This fix will break compatibility with postcss-loader v3.0 and lower, however this should not be a problem as postcss-loader is a controlled dependency of @design-systems/bundle.

@fattslug fattslug added the bug Something isn't working label Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant