You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: This module cannot be imported from a Client Component module. It should only be used from a Server Component.
The problem appears to be that the Bright component doesn't work when dynamically imported from a server component. It thinks it is in a client component even though it isn't.
My code works fine without Bright. I can dynamically import the mdx component from my server component.
The text was updated successfully, but these errors were encountered:
Strange. That error comes from the server-only package (a dependency of Bright) developed by the React team. For me, your code makes sense and it should work, but maybe there is some limitation that we are not seeing.
Here's a repro of the issue: https://codesandbox.io/p/sandbox/2spsii?file=%2Fapp%2Fmdx%2F%5Bslug%5D%2Fpage.tsx%3A10%2C19
(click the link when it's opened)
Error:
The problem appears to be that the Bright component doesn't work when dynamically imported from a server component. It thinks it is in a client component even though it isn't.
My code works fine without Bright. I can dynamically import the mdx component from my server component.
The text was updated successfully, but these errors were encountered: