-
Notifications
You must be signed in to change notification settings - Fork 456
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
[Bug]: [REACT - Next.js] floating-ui is causing server error on SSR #2970
Comments
Hello @maciej-jezierski , thank you for creating issue ticket, as far as I know since next 13, you have to differentiate server side and client side component with |
hey @Szymon-dziewonski the problem in the above code we didn't use floating ui, yet it was invoked. This is the only component as we are testing waters now. |
I know that in next we need to explicitly mention which components are client component because the interactivity can not happen on the server. I will copy the source code of the button and try some stuff then report the findings here. |
In the current project, we copied the source code of the button and made our own custom button from the storefront base. import {
type SfButtonProps as OriginalSfButtonProps,
SfButtonSize,
SfButtonVariant,
polymorphicForwardRef
} from '@storefront-ui/react'; After trying out some stuff, it became apparent that importing and using anything from In other words, I can simply use the normal |
And I think if the Storefront UI components should only be rendered on the client, wouldn't it be better to add |
We've been investigating this issue a bit and went to the same conclusion as @karimshalapy. Using any component from the SFUI simply does not work as RSC at the moment. Unfortunately, We can't suggest anything better than using |
@karimshalapy |
@Szymon-dziewonski If all components are available only on the client side it vastly limits the usability of the framework on production usage in ecommerce where clients place very high importance on SEO and links should be ready once server rendering is finished. |
@maciej-jezierski I understand that, totally agree with you, some of components like At the end, we are not yet know what is the issue but for sure we will investigate. I do appreciate your contribution here, we definitely will check this out, once we will have some answers we will respond here. Thanks! |
Describe the Bug
We set up a project with the instruction of the https://docs.storefrontui.io/v2/react/getting-started.html
After set up we added SfButton and got an intermediate error
Expected behavior
Adding any component shouldn't cause errors on SSR
Steps to reproduce
Remove "use client"; line and it starts break
app/page.tsx
Able to fix / change the documentation?
Code of Conduct
The text was updated successfully, but these errors were encountered: