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

Docs tab breaks in alpha 6.5.0-alpha.64 and 6.5.0-beta.0 #18027

Closed
Stunext opened this issue Apr 22, 2022 · 8 comments
Closed

Docs tab breaks in alpha 6.5.0-alpha.64 and 6.5.0-beta.0 #18027

Stunext opened this issue Apr 22, 2022 · 8 comments

Comments

@Stunext
Copy link

Stunext commented Apr 22, 2022

Describe the bug

Doc tab does not work in alpha

Uncaught TypeError: Cannot read properties of undefined (reading 'content')
    at index-1adc6033.js:352:1262
    at handleInterpolation (index.js:3482:24)
    at serializeStyles3 (index.js:3597:15)
    at index.js:3805:24
    at index.js:2509:12
    at renderWithHooks (react-dom.development.js:16141:18)
    at updateForwardRef (react-dom.development.js:19968:20)
    at beginWork (react-dom.development.js:22391:16)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:4157:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4206:16)

The above error occurred in the <Styled(div)> component:

    at http://localhost:6006/node_modules/.vite-storybook/deps/chunk-MACX4R7D.js?v=61a43f74:1983:45
    at MDXProvider2 (http://localhost:6006/node_modules/.vite-storybook/deps/chunk-E7FCCYB6.js?v=61a43f74:121:46)
    at ThemeProvider2 (http://localhost:6006/node_modules/.vite-storybook/deps/chunk-2XDOJFKN.js?v=61a43f74:4060:46)
    at SourceContainer2 (http://localhost:6006/node_modules/.vite-storybook/deps/chunk-2XDOJFKN.js?v=61a43f74:1876:23)
    at DocsContainer2 (http://localhost:6006/node_modules/.vite-storybook/deps/chunk-2XDOJFKN.js?v=61a43f74:6972:22)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

To Reproduce

Can use this repo with Vite Builder and React 18

https://github.com/Stunext/docsBug

Additional context

Still:

Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

And:

The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".

Sometimes:

You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.
@Stunext Stunext changed the title Docs tab breaks in alpha 6.5.0-alpha.64 Docs tab breaks in alpha 6.5.0-alpha.64 and 6.5.0-beta.0 Apr 25, 2022
@IanVS
Copy link
Member

IanVS commented Apr 25, 2022

I believe that the warning message:

The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".

Began before the change to use react 18, I've seen it in some of the older alphas. Similarly, there's still a call to the legacy react-dom that I guess hasn't been fixed yet. #10543 (comment).

The vite builder docs pages in the react-18 example work okay when updating to the beta, so I'll need to take a look at your repro, thanks for providing it.

@IanVS
Copy link
Member

IanVS commented Apr 25, 2022

The error you're seeing seems to be due to a broken transitive dependency, though I can't tell which one. When I remove node_modules and package-lock.json, and re-install, everything works fine. I don't think this is related to react 18, or to the vite builder, but rather something in emotion or mdx, is my guess.

@Stunext
Copy link
Author

Stunext commented Apr 25, 2022

You can provide me a copy of this repo or something?
"The vite builder docs pages in the react-18 example work okay when updating to the beta"

@IanVS
Copy link
Member

IanVS commented Apr 25, 2022

Sure, it's https://github.com/storybookjs/builder-vite. There is a directory called examples. The only thing to note is to be sure to update all examples to the same version of storybook, otherwise yarn does some weird hoisting and causes problems.

@Stunext Stunext closed this as completed May 6, 2022
@gewisser
Copy link

gewisser commented Feb 3, 2023

Please tell me what needs to be done to make the documentation section work?

image
image

@gewisser
Copy link

gewisser commented Feb 6, 2023

image

@gewisser
Copy link

gewisser commented Feb 6, 2023

image

@gewisser
Copy link

gewisser commented Feb 6, 2023

image

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