Next.js Discord

Discord Forum

Entire page deopted into client-side rendering

Answered
Elite posted this in #help-forum
Open in Discord
So when i run npm run build to test my build, i get this error
Entire page deopted into client-side rendering
for several of my pages.
I looked at the link and it says that its due to uing useSearchParams with no Suspense Boundary.

I use it in one place (my google analytics component), that is put onto my root layout:
https://gist.github.com/navincodesalot/1b84c87b98481a8938f3987632ad70a1

would i add a suspense wrapped around those scripts here?
Answered by Holland Lop
import { Suspense } from 'react'

export default function Layout() {
const fallback = <div>loading...</div>
return (
#Unknown Channel
// other components
<Suspense fallback={fallback}>
<SearchInput/>
</Suspense>

</>
)
}
View full answer

4 Replies

also what does it mean by deopted into csr?
does it mean that the whole page is a client comp, instead of certain parts being server (if its allowed for them)
Holland Lop
import { Suspense } from 'react'

export default function Layout() {
const fallback = <div>loading...</div>
return (
#Unknown Channel
// other components
<Suspense fallback={fallback}>
<SearchInput/>
</Suspense>

</>
)
}
Answer
Holland Lop
And Yes deopted into csr means that component acts like client component despite 'use server'