#Dynamic server usage: Route /posts couldn't be rendered statically because it used cookie

19 messages · Page 1 of 1 (latest)

cloud crow
#

can someone help me?
I had my next.js application structured like: /app/[locale]/[lang]/**, but then I removed the locale and lang and now I have some issues like this one:
Dynamic server usage: Route /posts couldn't be rendered statically because it used cookies

If I add the locale and lang folders again the errors disappear

I already deleted the .next folder and ran the script again. The error persists...

light forgeBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

sudden juniper
cloud crow
#

and what do you mean by saving the locale with the cookies func?

sudden juniper
cloud crow
sudden juniper
sudden juniper
cloud crow
#

it seems like I fixed. when I run the build script locally it works fine, but the pipeline is always failing

#

why would I need to do this?

sudden juniper
# cloud crow ⨯ useSearchParams() should be wrapped in a suspense boundary at page "/auth". Re...

Reading search parameters through useSearchParams() without a Suspense boundary will opt the entire page into client-side rendering. This could cause your page to be blank until the client-side JavaScript has loaded.

So you might want to wrap your Component that uses useSearchParams inside a suspense boundary like:

<Suspsense fallback={<p>Some Fallback</p>}>
  <ComponentThatNeedsSearchParams />
</Suspense>
cloud crow
sudden juniper
cloud crow
#

yeah it makes sense

#

i appreciate ur help

light forgeBOT