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

Objects are not valid as a React child #127

Closed
willo-icon opened this issue Jan 23, 2025 · 14 comments · Fixed by #131
Closed

Objects are not valid as a React child #127

willo-icon opened this issue Jan 23, 2025 · 14 comments · Fixed by #131

Comments

@willo-icon
Copy link

Just updated to 8.0.0 and I'm getting this:

Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props}). If you meant to render a collection of children, use an array instead.
    at throwOnInvalidObjectType (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:9981:17)
    at reconcileChildFibers2 (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:10611:15)
    at reconcileChildren (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:14338:37)
    at mountIndeterminateComponent (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:15034:13)
    at beginWork (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:15962:22)
    at beginWork$1 (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:19806:22)
    at performUnitOfWork (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:19251:20)
    at workLoopSync (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:19190:13)
    at renderRootSync (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:19169:15)
    at recoverFromConcurrentError (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-MYEXOB6E.js?v=3e4323a5:18786:28)

It goes away if I disable the storybook-addon-apollo-client addon in main.ts, or if I revert to 7.3.0.

Here are my relevant dependencies and versions:

"@storybook/addon-actions": "^8.5.1",
"@storybook/addon-console": "^3.0.0",
"@storybook/addon-essentials": "^8.5.1",
"@storybook/addon-interactions": "^8.5.1",
"@storybook/addon-links": "^8.5.1",
"@storybook/addon-onboarding": "^8.5.1",
"@storybook/blocks": "^8.5.1",
"@storybook/react": "^8.5.1",
"@storybook/react-vite": "^8.5.1",
"@storybook/test": "^8.5.1",
"@vitejs/plugin-react-swc": "^3.7.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.5.1",
"storybook-addon-apollo-client": "^8.0.0",
"typescript": "^5.7.3",
"vite": "^6.0.11",
@lifeiscontent
Copy link
Owner

lifeiscontent commented Jan 23, 2025

@willo-icon can you put a small reproduction together? Its working in the test project of this repo and hard to debug without one 😅

sorry you ran into this!

@willo-icon
Copy link
Author

No sweat, I will try to get one going in a bit. Thanks for the quick response.

@philostler
Copy link

Encountered this also when moving to v8

@lifeiscontent
Copy link
Owner

@philostler can you put a reproduction together?

@joostslijkoort
Copy link

I am running into the same problem, it could have something to do with the fact that i'm moving to react-vite. I will put a reproduction together!

@joostslijkoort
Copy link

joostslijkoort commented Feb 14, 2025

I scaffolded this repo to reproduce the issue. The problem is when running React 18.

@lifeiscontent
Copy link
Owner

@joostslijkoort thanks! Fixed in 8.1.0 if you run into any issues, try clearing your node_modules/.cache folder

@anthonyjgrove
Copy link

I am still seeing this issue in 8.1.0.

@RickCardoso
Copy link

RickCardoso commented Feb 16, 2025

Still seeing the issue in 8.1.0 as well, even after cleaning cache

@RickCardoso
Copy link

@anthonyjgrove , downgrading the addon to 7.3.0 works with Storybook 8.5.3.

@philostler
Copy link

Tested this with 8.1.1 this morning and still seeing the same issue. Running Storybook 8.4.7

@lifeiscontent
Copy link
Owner

lifeiscontent commented Feb 18, 2025

@anthonyjgrove @RickCardoso @philostler sorry for the false positive here, I've reached out to the storybook team about it and Shilman (the lead maintainer) is helping me find someone within storybook to help uncover what might be going on, storybook recently made react an internal dependency (they have their own version of react for addons and the story manager) and I suspect this is what might be causing the issue. Will report back once we uncover what's going on.

@lifeiscontent lifeiscontent reopened this Feb 18, 2025
@lifeiscontent
Copy link
Owner

just for context: you can track more info on this here: storybookjs/storybook#30552

@lifeiscontent
Copy link
Owner

should be fixed in latest release now :)

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

Successfully merging a pull request may close this issue.

6 participants