Storybook: @storybook/[email protected] doesn't work with import inside css in react-scripts@^1

Created on 21 May 2017  ·  3Comments  ·  Source: storybookjs/storybook

As I wrote in #1073 (I've being asked to open a new issue):

Might related to #1027

But, it doesn't compatible with react-scripts@^1 when it comes to CSS. If you have a CSS files that import other CSS files, it breaks with this error:

ERROR in ./~/css-loader?{"importLoaders":1}!./~/postcss-loader/lib?{"plugins":[null]}!./src/stories/blah.css
Module build failed: TypeError: Cannot read property 'postcss' of null

Code example:

/* a.css */
@import "./b.css";
/* b.css */

:root {
  /* ... */
}
// Story file
import "./a.css";

If there is more information needed, please tell me.

babel / webpack bug compatibility with other tools

Most helpful comment

I will look into this.

I have reproduced the issue.

I have a fix!

All 3 comments

Thanks @oriSomething! We'll look into it!

I will look into this.

I have reproduced the issue.

I have a fix!

It should be fixed now:

Successfully published:
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
 - @storybook/[email protected]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gongreg picture Gongreg  ·  58Comments

p3k picture p3k  ·  61Comments

bpeab picture bpeab  ·  70Comments

ilyaulyanov picture ilyaulyanov  ·  100Comments

hckhanh picture hckhanh  ·  69Comments