question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable PostCSS deprecation warning

See original GitHub issue

Describe the bug Starting Storybook 6.2+ will trigger a deprecation warning, which will make the console output look quite noisy. The warning is about deprecating the implicit PostCSS loader, which is guess is fine to show… if it’s actually being used. I’m not using any CSS in our project, and so I don’t want such a warning to clutter the console output. My OCD wants to do away with warnings 😀, but this one seems to be hardcoded into Storybook.

In the source I can see that it’s always generating that warning for everyone. Except if you explicitly add addon-postcss.

This seems backwards to me. Why should I add an addon that I don’t need, in order to hide a warning about its functionality that I wasn’t using in the first place??

To Reproduce Steps to reproduce the behavior:

  1. Make sure not to have any CSS in the project
  2. Make sure not to accidentally install postcss-addon
  3. Start Storybook 6.2
  4. Watch the console.

Expected behavior If not using PostCSS: don’t bother the console with it. If using PostCSS: do warn about installing the addon.

Screenshots image

System Please paste the results of npx sb@next info here.

Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
  Binaries:
    Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 89.0.4389.114
    Edge: Spartan (44.19041.423.0), Chromium (89.0.774.63)
  npmPackages:
    @storybook/addon-docs: 6.2.1 => 6.2.1
    @storybook/addon-links: 6.2.1 => 6.2.1
    @storybook/addons: 6.2.1 => 6.2.1
    @storybook/react: 6.2.1 => 6.2.1

┆Issue is synchronized with this Asana task by Unito

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JohnCasabcommented, Apr 6, 2021

If you dont use Postcss you can paste this in your .storybook/main.js

module.exports = {
  features: {
    postcss: false,
  },
};

As suggested in the documentation: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-implicit-postcss-loader

2reactions
shilmancommented, Apr 5, 2021

Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.3 containing PR #14478 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Closing this issue. Please re-open if you think there’s still more to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Address "postcss.plugin was deprecated" warning
Whilst looking to upgrade our custom plugin, I found out nothing changes if I remove the plugin on my local after running a...
Read more >
How to suppress warnings using webpack and post css
You can use the stats.warningsFilter. Try with something like this: module.exports = { ... stats: { warningsFilter: [ './~/css-loader!
Read more >
Storybook Addon PostCSS
Storybook addon used to run the PostCSS preprocessor against your stories. ... Install this addon by adding the @storybook/addon-postcss dependency:
Read more >
PostCSS API
This method is provided as a convenience wrapper for Result#warn . Declaration: { bad: (decl, { result }) => { decl.warn(result, 'Deprecated property...
Read more >
CHANGELOG.md | postcss@8.4.16
Postcss for Deno. ... Removed PostCSS does nothing warning by lazy parser (Bogdan Dolin). ... Remove deprecated method from PostCSS 4.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found