UPDATE
Seems related to https://github.com/storybooks/storybook/issues/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
Uncaught TypeError: Object(...) is not a functionTypeError: _addons.default.getElements is not a function and other errorsTo Reproduce
Steps to reproduce the behavior:
Screenshots

// vendors-main:1624
var Styled = Object(_emotion_core__WEBPACK_IMPORTED_MODULE_2__["withCSSContext"])(function (props, context) { // <--- failing part
// ...
}
@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?
@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!
Found it https://github.com/storybooks/storybook/tree/next/addons
Now everything works like a charm on v5. ✅
Thanks @shilman
Sorry for bothering
No worries, good luck!
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]


Is there a way I could get it to work without having to upgrade my React to v16?
Thanks!
@pnarielwala-tc can you open a separate issue? SB5 should work with React v15
@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.