[v11] Tabs: Error when SSRing in Next.js
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nextjs, react
- Domain
- frontend
Research direction
Start by running the linked nextjs-quickstart-nextgen reproducer locally and inspect app/page.tsx, comparing the failing SSR setup with the version where "use client" is enabled. Trace the Tabs component usage and verify that the page renders without the invalid-element error during SSR while retaining the expected client behavior.
Written by the indexing model from the issue text.
Description
Describe the bug
Love the project! Very helpful :)
With v11 alpha.7 (I'm guessing earlier versions too, that's just the only one I tested) you get an error in the browser when trying to use the Tabs component in a page that is SSR.
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
I followed this guide to setup up ReactPrime in my project: https://v11.primereact.org/docs/installation/nextjs
This might apply to other components too. I haven't tried many yet.
Reproducer
https://stackblitz.com/edit/stackblitz-starters-7lommp8z
System Information
System:
OS: macOS 15.6.1
CPU: (10) arm64 Apple M2 Pro
Memory: 1.03 GB / 32.00 GB
Shell: 4.0.2 - /opt/homebrew/bin/fish
Binaries:
Node: 20.19.4 - /opt/homebrew/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.8.2 - /opt/homebrew/bin/npm
Deno: 2.4.5 - /opt/homebrew/bin/deno
Browsers:
Chrome: 142.0.7444.135
Edge: 142.0.3595.65
Firefox: 145.0
Safari: 26.1
npmPackages:
primereact: ^11.0.0-alpha.7 => 11.0.0-alpha.7
react: 19.2.0 => 19.2.0
tailwindcss: ^4 => 4.1.17
Steps to reproduce the behavior
-
Download and run the stackblitz project. I couldn't get it to actually run in stackbliz in the browser due to issues with next.js's turbopack and wasm but if you download the project and run it locally it should work. The project is just https://github.com/primefaces/primereact-examples/tree/main/nextjs-quickstart-nextgen that is linked to from https://v11.primereact.org/docs/installation/nextjs and has been updated to the latest version of prime react v11 and nextjs + the Tabs component added and
"use client;"commented out. -
Observe the error
-
Uncomment
"use client;"in app/page.tsx -
Observe that the error goes away.
Expected behavior
No error to occur.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from primefaces/primereact
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8552 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
primefaces/primereact#8550 ·
-
Row checkbox selection tick is invisible in Landing Page Theme sectionPossibly taken @Prakash1185 claimed this 173 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
primefaces/primereact#8545 ·
-
Dependency conflict between jspdf v4 and jspdf-autotable during npm installPossibly taken @Kamran92 claimed this 187 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8537 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
primefaces/primereact#8551 ·
All issues in primefaces/primereact
Similar issues
-
[BUG]: Shared links drop the configured basePath on GitHub PagesPossibly taken @anshulchikhale30-p claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Leonxlnx/taste-skill#216 ·
Maintainers usually reply within 1 day
-
area: ui Bug Payload OSS
Difficulty 1/5 Under an hour Newbie friendliness 88/100
payloadcms/payload#19839 ·
Maintainers usually reply within 1 day
-
BoxShadow.lerp returns the wrong blur style at t = 0 or t = 1Possibly taken @ArtemChikolaev claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day