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

React: RSCs don't render correctly in Docs #25594

Open
shilman opened this issue Jan 14, 2024 · 1 comment
Open

React: RSCs don't render correctly in Docs #25594

shilman opened this issue Jan 14, 2024 · 1 comment

Comments

@shilman
Copy link
Member

shilman commented Jan 14, 2024

Describe the bug

When I enable RSCs in Next.js they render fine as individual stories. However, on the docs page they show up blank:

image

In the console is the typical error message:

Warning: async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding 'use client' to a module that was originally written for the server.

Also, navigating away from the page locks up the browser.

To Reproduce

No response

System

No response

Additional context

No response

@shilman
Copy link
Member Author

shilman commented Jan 29, 2024

This appears to be a limitation of React, which is unable to render multiple async component roots on the client. Repro: https://github.com/shilman/vite-rsc-test

To workaround this you can disable inline docs rendering. This is not ideal because controls are broken for iframe stories #11908 , but it's something.

  parameters: { docs: { story: { inline: false } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Empathy Backlog
Status: No status
Development

No branches or pull requests

2 participants