15.1 dynamicIO access to dynamic data in server components
Unanswered
Hudsonian Godwit posted this in #help-forum
Hudsonian GodwitOP
The example of validating session on pages or before fetching data layed out in the docs no longer works in the latest version. Dynamic data is no longer accessible in dynamic routes (Error: A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it.
Cookies also can't be accessed in cached functions. How then is the supposed way of validating a user session before fetching respective data? The way it is suggested in the DAL example in the docs just doesn't work in 15.1 with dynamicIO = true.
Am I wrong?
Cookies also can't be accessed in cached functions. How then is the supposed way of validating a user session before fetching respective data? The way it is suggested in the DAL example in the docs just doesn't work in 15.1 with dynamicIO = true.
Am I wrong?
5 Replies
@Hudsonian Godwit The example of validating session on pages or before fetching data layed out in the docs no longer works in the latest version. Dynamic data is no longer accessible in dynamic routes (Error: || A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it.||
Cookies also can't be accessed in cached functions. How then is the supposed way of validating a user session before fetching respective data? The way it is suggested in the DAL example in the docs just doesn't work in 15.1 with dynamicIO = true.
Am I wrong?
Northeast Congo Lion
Hey dude! Just came by to mention/ask/open a discussion about this exactly.
Wondering what the current pattern is.
Wondering what the current pattern is.
I'm using cookies to handle my sessions, so 🤷🏻
Hudsonian GodwitOP
I rolled back to dynamicIO false. Wasn’t worth the trouble
@Hudsonian Godwit I rolled back to dynamicIO false. Wasn’t worth the trouble
Northeast Congo Lion
I'll keep it.
I think we need to wait for answers, wether it's a bug (doubt it), they need to handle specific cases (maybe allow cookies?) or "giving us" specific patterns (we may as well find it ourselves of course), I can't stand not knowing what's cached and what not.
Even if I lose the caching benefits, I think it's better to have manual control over it.
I don't know if fetch is still patched though? I hope is not.
Anyways, thanks for answering 🙏🏻
I'll come back here if I find an answer for this.
I think we need to wait for answers, wether it's a bug (doubt it), they need to handle specific cases (maybe allow cookies?) or "giving us" specific patterns (we may as well find it ourselves of course), I can't stand not knowing what's cached and what not.
Even if I lose the caching benefits, I think it's better to have manual control over it.
I don't know if fetch is still patched though? I hope is not.
Anyways, thanks for answering 🙏🏻
I'll come back here if I find an answer for this.
Hudsonian GodwitOP
I think there is a reason it’s canary, but do come back I‘m curious as well