Scaffolding routes when we don't know what the path is going to be, but need to do server side pagination for a page type like a resource list. #65984
Unanswered
jackkemmish
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Hi there,
Hoping someone could shed some light on my situation.
We are querying data from a CMS, and we aren't going to know the paths needed to section off functionality like many examples show e.g.
/shop/
,/page/
which naturally would make it easier to handle the below.For example, we have a few different page types, for simplicity, one is a general content page which just needs a simple fetch request to load the data. We then have a resource list page which has resource pages as children. This resource list page needs pagination/filtering etc and ideally we'd do this server side rather than client side.
The issue I am having is trying to amalgamate both of these into one catch all route. The initial fetch request for the page is fine, but the fact I need to use
searchParams
and creating another fetch request with the limit/offset from the URL params is causing aDYNAMIC_SERVER_USAGE
error:An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.]
I can set
export const dynamic = 'force-dynamic'
to fix this, but it will in turn make all pages not cached which also isn't ideal.Does/has anyone got a solution for this?
Thanks in advance.
Jack
Additional information
I've seen someone has had a similar issue here #54050
Beta Was this translation helpful? Give feedback.
All reactions