You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pages are not generated statically when prefetching in a page or directly in a layout. If we remove all prefetch (be it await or void) then pages are generated statically.
Its mostly an issue when fetching some data from a CMS, as prefetch all or each the data from CMS will be a good way to render page statically
Tried to use next 15's static page symbol after upgrading, there also no static page symbol is showing when prefetching at the page/layout
Isn't this correct? headers() rejects so Next knows to make the page dynamic? I think this is just an internal error that they catch, if there was an actual issue the error would show without --debug flag?
Pages are not generated statically when prefetching in a page or directly in a layout.
No, you'd need to export const dynamic = 'force-static' to force dynamic when doing dynamic stuff. If you do so the trpc procedures runs during build and the page is outputted as static:
Provide environment information
Describe the bug
Pages are not generated statically when prefetching in a page or directly in a layout. If we remove all prefetch (be it
await
orvoid
) then pages are generated statically.Its mostly an issue when fetching some data from a CMS, as prefetch all or each the data from CMS will be a good way to render page statically
Tried to use next 15's static page symbol after upgrading, there also no static page symbol is showing when prefetching at the page/layout
Reproduction repo
https://github.com/t3-oss/create-t3-app
To reproduce
--debug
Static generation failed due to dynamic usage on /, reason: headers
Additional information
With prefetch at page level
Without prefetch
The text was updated successfully, but these errors were encountered: