Next.js Discord

Discord Forum

App Router: Fetching data in root layout

Unanswered
Brown bear posted this in #help-forum
Open in Discord
Brown bearOP
I'm fetching data in the route layout, which will cause the build step to fail as it tries to load the data. The backend API does not exist for example in CI, where the app is built.
Is there some way to disable static prerendering in next build?

Also created an issue in GitHub: https://github.com/vercel/next.js/issues/51395
Repro link: https://codesandbox.io/p/sandbox/adoring-bartik-66swjf

1 Reply