Prerendering error
Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Cuvier’s Dwarf CaimanOP
I'm getting this error on page /[id] when building
I added generateStaticParams as it says here:
https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#generating-static-params.
But I don't know what is wrong.
Error occurred prerendering page "/[id]". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Route "/[id]" has a `generateMetadata` that depends on Request data (`cookies()`, etc...) or external data (`fetch(...)`, etc...) but the rest of the route was static or only used cached data (`"use cache"`). If you expected this route to be prerenderable update your `generateMetadata` to not use Request data and only use cached external data. Otherwise, add `await connection()` somewhere within this route to indicate explicitly it should not be prerendered.
Export encountered an error on /[id]/page: /[id], exiting the build.
⨯ Static worker exited with code: 1 and signal: null
I added generateStaticParams as it says here:
https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#generating-static-params.
But I don't know what is wrong.
3 Replies
Cuvier’s Dwarf CaimanOP
I'm using this versions of next and react, testing experimental.dynamicIO
you can use "use cache"
Cuvier’s Dwarf CaimanOP
I tried before, throws error because of the params