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
No support for non-server components in Next.js #1632
Comments
@Johnrobmiller I'm afraid we don't have documentation for Next <13. This is because React Cosmos 6 was released after Next 13 and the revamped docs and Cosmos Next.js APIs were molded for Next 13 from the start. That said, the That said said, even though the Cosmos Next.js layer has few lines of code, it is a bit complex because it configures React Cosmos to work with Server Components. With older Next.js versions Server Components are irrelevant if I'm not mistaken, in which case following the Custom Bundler Setup is way more straightforward. The main difference from a custom bundler setup is that instead of calling react-cosmos/packages/react-cosmos-dom/src/mountDomRenderer.tsx Lines 26 to 29 in db623aa
Let me know if you decide to give this a try and I'm happy to answer questions. |
This issue actually doesn't relate to next 13 - the stacktrace is because react-cosmos-next is an ESM module and it is importing next/navigation without a file extension. You need to add |
I tried setting up Cosmos with the non-server compoent version of Next.js (i.e., any Next.js verions less than 13.0), but sadly it looks like it's not possible, otherwise I wouldn't be seeing this missing dep error from a server compositing library here. Any plans to support this?
First screenshot: the error that shows the missing dependency.
Second screenshot: shows my setup
The text was updated successfully, but these errors were encountered: