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.

Storybook 6.1.0-rc.4 & Emotion 11.0 support

See original GitHub issue

Describe the bug When you upgrade emotion (@emotion/css) to version 11.0 - storybook seems to build successfully, but on every single set of stories, simply renders this error screen:

Screen Shot 2020-11-17 at 2 43 32 pm

To Reproduce

  1. Init a basic storybook
  2. Install @emotion/css and @emotion/babel-plugin
  3. setup a basic component which uses { css } from @emotion/css
  4. do npm run build-storybook
  5. See error:
css is not defined
ReferenceError: css is not defined
    ...

Code snippets

//./storybook/main.js
module.exports = {
  stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    '@storybook/addon-knobs',
  ],
  typescript: { reactDocgen: 'react-docgen' },
};

System

$ npx sb@next info

Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
    Yarn: 1.19.0 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
  Browsers:
    Chrome: 86.0.4240.198
    Edge: 86.0.622.69
    Firefox: 82.0.3
    Safari: 14.0.1
  npmPackages:
    @storybook/addon-actions: ^6.1.0-rc.4 => 6.1.0-rc.4 
    @storybook/addon-essentials: ^6.1.0-rc.4 => 6.1.0-rc.4 
    @storybook/addon-knobs: ^6.1.0-rc.4 => 6.1.0-rc.4 
    @storybook/addon-links: ^6.1.0-rc.4 => 6.1.0-rc.4 
    @storybook/react: ^6.1.0-rc.4 => 6.1.0-rc.4 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:39
  • Comments:59 (18 by maintainers)

github_iconTop GitHub Comments

23reactions
shilmancommented, Jan 30, 2022

FYI we are working on a proper fix for this–not a workaround–hopefully arriving in the next few days.

22reactions
shilmancommented, Feb 1, 2022

Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.31 containing PR #17000 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

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

Storybook 6.1.0-rc.4 & Emotion 11.0 support #13145 - Issuehunt
Describe the bug When you upgrade emotion (@emotion/css) to version 11.0 - storybook seems to build successfully, but on every single set of...
Read more >
Storybook 6.1
Storybook is the industry standard UI component workshop. It organizes components and their states to structure UI development, testing, ...
Read more >
@storybook/react | Yarn - Package Manager
Storybook for React: Develop React Component in isolation with Hot Reloading. ... Support Angular 15.0.4 #20287; CLI: execute automigrations when pressing ...
Read more >
Using Storybook 6.1 with Next.js and Emotion 11
Overview. We've added Storybook side-by-side with our Next.js application. It took us about 4 days of intensive work.
Read more >
storybook導入時にエラーと戦ったので忘備録 - Qiita
storybook を導入する時にエラーが出て、なかなか実装が進まなかったため忘備録です。 環境. Next.js: 12.1.0 chakra-ui: 1.8.6 emotion: 11 storybook: ...
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