useSearchParams() should be wrapped in a suspense boundary
wbleonard opened this issue · 2 comments
I'm receiving the following error during the static page generation for /, reset-password, and login when running 'docker compose build':
28.83 Generating static pages (0/16) ...
29.55
29.55 ⨯ useSearchParams() should be wrapped in a suspense boundary at page "/reset-password". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
29.55
29.55 Error occurred prerendering page "/reset-password". Read more: https://nextjs.org/docs/messages/prerender-error
29.55
29.56 ⨯ useSearchParams() should be wrapped in a suspense boundary at page "/". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
29.56
29.56 Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
29.56
29.56
Generating static pages (4/16)
Generating static pages (8/16)
29.70
29.70 ⨯ useSearchParams() should be wrapped in a suspense boundary at page "/login". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
29.70
29.70 Error occurred prerendering page "/login". Read more: https://nextjs.org/docs/messages/prerender-error
29.70
Generating static pages (12/16)
✓ Generating static pages (16/16)
30.28
30.28 > Export encountered errors on following paths:
30.28 /login/page: /login
30.28 /page: /
30.28 /reset-password/page: /reset-password
------
failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
Thanks for opening up this issue @wbleonard. We've gone ahead and filed a JIRA task. Please check here to track the progress of this issue.
Had the same issue, its due to a minor update to one of the dependencies, not sure which one I just locked them all down to the exact versions and got the example working. Before that I tried wrapping in suspense boundaries but with no joy, might be due to my poor frontend skills, but did find a case in this thread where useSearchParams() was not in use but the error was still thrown https://www.reddit.com/r/nextjs/comments/1akleto/usesearchparams_should_be_wrapped_in_a_suspense/?rdt=33287