Storybook: "export 'default' (imported as 'Stylis') was not found in 'stylis/stylis.min'

Created on 5 Mar 2019  路  6Comments  路  Source: storybookjs/storybook

Describe the bug
I'm getting that error when trying to add some component that uses styled components

WARNING in ./packages/Component/node_modules/styled-components/dist/styled-components.browser.esm.js 258:25-31
"export 'default' (imported as 'Stylis') was not found in 'stylis/stylis.min'
 @ ./packages/Component/src/index.js
 @ ./packages/index.js
 @ ./.storybook/config.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

To Reproduce
Steps to reproduce the behavior:
add an component with styled-components
run storybook

compatibility with other tools inactive question / support

Most helpful comment

Hey..
Same here

storybook: 5.2.8
styled-components: 4.4.1

did anyone solve the issue ?

All 6 comments

I'm getting the same error, but just when I use createGlobalStyle.

Explain

I'm started a new project from scratch and the error just appeared when I tried to use createGlobalStyle, not before.

I also get the error

WARNING in ./.storybook/config.js 36:18-35
"export 'createGlobalStyle' was not found in 'styled-components'
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

package.json

{
  "name": "root",
  "private": true,
  "scripts": {
    "storybook": "start-storybook -p 9001 -c .storybook"
  },
  "devDependencies": {
    "@babel/core": "^7.3.4",
    "@storybook/addon-info": "^5.0.0",
    "@storybook/react": "^5.0.0",
    "babel-loader": "^8.0.5",
    "lerna": "^3.13.1"
  },
  "dependencies": {
    "react": "^16.8.4",
    "react-dom": "^16.8.4",
    "styled-components": "^4.1.3"
  }
}

it not works even with emotion, getting

ReferenceError: exports is not defined
    at react-is.development.js:18
    at Module../packages/comp-button/node_modules/react-is/cjs/react-is.development.js (react-is.development.js:226)
...

I'm getting the same error, but just when I use createGlobalStyle.

Explain

I'm started a new project from scratch and the error just appeared when I tried to use createGlobalStyle, not before.

I also get the error

WARNING in ./.storybook/config.js 36:18-35
"export 'createGlobalStyle' was not found in 'styled-components'
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

package.json

{
  "name": "root",
  "private": true,
  "scripts": {
    "storybook": "start-storybook -p 9001 -c .storybook"
  },
  "devDependencies": {
    "@babel/core": "^7.3.4",
    "@storybook/addon-info": "^5.0.0",
    "@storybook/react": "^5.0.0",
    "babel-loader": "^8.0.5",
    "lerna": "^3.13.1"
  },
  "dependencies": {
    "react": "^16.8.4",
    "react-dom": "^16.8.4",
    "styled-components": "^4.1.3"
  }
}

did you get working storybook with styled-components without createGlobalStyle?

Now, with the 5.0.1 styled-components, createGlobalStyle and css works like a charm :)

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hey..
Same here

storybook: 5.2.8
styled-components: 4.4.1

did anyone solve the issue ?

Was this page helpful?
0 / 5 - 0 ratings