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

Storybook v4 addons break storybook v5 #5645

Closed
Rolandisimo opened this issue Feb 18, 2019 · 7 comments
Closed

Storybook v4 addons break storybook v5 #5645

Rolandisimo opened this issue Feb 18, 2019 · 7 comments

Comments

@Rolandisimo
Copy link

Rolandisimo commented Feb 18, 2019

UPDATE
Seems related to #4525


Describe the bug
"@storybook/react": "^4.1.12" causes storybook not being able to run with the current CRA2 project causing Uncaught TypeError: Object(...) is not a function.

✅ Below is a dependency list that worked for the ongoing project and a clean CRA2 app if addons are not registered:

    "@storybook/addon-actions": "^4.1.12",
    "@storybook/addon-knobs": "^4.1.12",
    "@storybook/addon-links": "^4.1.12",
    "@storybook/addon-options": "^4.1.12",
    "@storybook/addons": "^4.1.12",
    "@storybook/react": "^5.0.0-rc.1", // <--- below version 5, storybook would throw the issue above

❌ Issue occurred after registering addons:

// .storybook/addons.js
import '@storybook/addon-knobs/register' // <--- any v4 addon fails the build

Result

  • With an ongoing CRA2 build, I get this: Uncaught TypeError: Object(...) is not a function
  • With a fresh CRA2 app, I get this: TypeError: _addons.default.getElements is not a function and other errors

To Reproduce
Steps to reproduce the behavior:

  1. Create CRA2 app
  2. Install dev dependencies as posted above
  3. Launch storybook
  4. Observe 👀

Screenshots

  • For ongoing CRA2 project:
    screenshot 2019-02-18 at 12 17 07
// vendors-main:1624
var Styled = Object(_emotion_core__WEBPACK_IMPORTED_MODULE_2__["withCSSContext"])(function (props, context) { // <--- failing part
  // ...
}
@Rolandisimo Rolandisimo changed the title Addons break storybook 5 Storybook v4 addons break storybook v5 Feb 18, 2019
@shilman
Copy link
Member

shilman commented Feb 18, 2019

@Rolandisimo v4 addons are not intended to be used with v5 -- that's why we're releasing this as 5.0.0 and not 4.2.0 (see https://semver.org/). Is there a reason you don't want to upgrade the addons as well?

@Rolandisimo
Copy link
Author

Rolandisimo commented Feb 18, 2019

@shilman I actually honestly searched for add-ons v5 but couldn't find them. Which made me suspicious, of course.

Could you provide a link possibly to a v5 release of addons?

Thanks!

@Rolandisimo
Copy link
Author

Rolandisimo commented Feb 18, 2019

Found it https://github.com/storybooks/storybook/tree/next/addons
Now everything works like a charm on v5. ✅

Thanks @shilman
Sorry for bothering

@shilman
Copy link
Member

shilman commented Feb 18, 2019

No worries, good luck!

@shilman shilman closed this as completed Feb 18, 2019
@pnarielwala-tc
Copy link

Hello! 👋 I'm getting this issue as well but with all my packages being on 4.1.12. I can't upgrade to v5 just yet as we're using [email protected] and [email protected]

Screen Shot 2019-04-23 at 5 16 54 PM

Screen Shot 2019-04-23 at 5 17 11 PM

Is there a way I could get it to work without having to upgrade my React to v16?

Thanks!

@shilman
Copy link
Member

shilman commented Apr 24, 2019

@pnarielwala-tc can you open a separate issue? SB5 should work with React v15

@Parthchokshi
Copy link

@pnarielwala-tc Hey! Did you solve or open that issue? I am getting the same error.

Using 4.1.18 for all storybook packages and 16.8.6 for react and react-dom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants