It seems that client components can be only directly imported from a page component.
For example, the News component located in rsc.server.js can import the Story client component just fine. If we, however, move the StoryWithData to a separate file (with the .server suffix or none i.e. a shared component), Next.js returns errors.
It seems that client components can be only directly imported from a page component.
For example, the
News
component located inrsc.server.js
can import theStory
client component just fine. If we, however, move theStoryWithData
to a separate file (with the.server
suffix or none i.e. a shared component), Next.js returns errors.Here's a diff off a branch from my fork that shows this issue: https://github.com/vercel/next-rsc-demo/compare/main...zaiste:non-page-server-comp-cannot-import-client-comp