[v11] Tabs: Error when SSRing in Next.js
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- nextjs, react
- Ambito
- frontend
Direzione di ricerca
Inizia eseguendo localmente il riproduttore collegato nextjs-quickstart-nextgen e ispeziona app/page.tsx, confrontando la configurazione SSR che fallisce con la versione in cui "use client" è abilitato. Traccia l’utilizzo del componente Tabs e verifica che la pagina venga renderizzata senza l’errore di elemento non valido durante l’SSR, mantenendo al contempo il comportamento client previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- CSS
- Stelle
- 8.3k
- Fork
- 1.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di primefaces/primereact
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
primefaces/primereact#8552 ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
primefaces/primereact#8550 ·
-
Row checkbox selection tick is invisible in Landing Page Theme sectionForse già presa @Prakash1185 l’ha presa 173 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
primefaces/primereact#8545 ·
-
Dependency conflict between jspdf v4 and jspdf-autotable during npm installForse già presa @Kamran92 l’ha presa 187 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
primefaces/primereact#8537 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
primefaces/primereact#8551 ·
Tutte le issue di primefaces/primereact
Issue simili
-
[BUG]: Shared links drop the configured basePath on GitHub PagesForse già presa @anshulchikhale30-p l’ha presa oggi. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 82/100
Leonxlnx/taste-skill#216 ·
I maintainer di solito rispondono entro 1 giorno
-
area: ui Bug Payload OSS
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
payloadcms/payload#19839 ·
I maintainer di solito rispondono entro 1 giorno
-
BoxShadow.lerp returns the wrong blur style at t = 0 or t = 1Forse già presa @ArtemChikolaev l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno