-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Not working with next.js 13 server components #4433
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
It works with The proper thing to do will be to use a Babel plugin to add |
Would this task be to simply add |
as a temporary work-around, you can do this (not sure how/if it effects tree-shaking, etc) // SUI.tsx
"use client"
export * from "semantic-ui-react" // usage
import { Container } from "@/SUI" |
No, that sounds correct. However, I would prefer this to be done as an automatic transform (babel plugin?). |
Is there a roadmap for resolving this issue as I am facing the same problem? |
It will be solved in upcoming beta release, PR is there already (#4452). However, Next.js does not support "dot-syntax" i.e. There is an issue related to the problem (vercel/next.js#44389), however with current implementation I don't believe that it's solvable on their side. I will create a follow-up PR to update examples to not reference that syntax. |
Codemod is available and can be used: npx @semantic-ui-react/codemod-dot-syntax --files="docs/src/examples/**/*.js" |
Released in |
for anyone coming back updating to the beta fixes the issues. Works nicely with SSC now |
Little bit late to the party but anyone has any example where the components are able to be rendered on nextjs 14 server side components? I'm still getting the same error about undefined property and I didn't add that codemod @layershifter was talking about, don't know if that's the solution to it. I'm using nextjs 14.2.3, semantic-ui-react 3.0.0-beta.2. Thanks in advance! |
Bug Report
Steps
Install clean next.js app, semantic-ui-react, using the new App Router
Add a
<Container>
or<Button>
to the main pagenpm run dev
Expected Result
The page should load with the semantic-ui components
Actual Result
The page will not work, displaying the error below
As a workaround, adding
'use client'
to the top of the page makes it workBut it disables Server Component features.
https://nextjs.org/docs/getting-started/react-essentials#server-components
Version
Testcase
The text was updated successfully, but these errors were encountered: