App Router: Fetching data in root layout
Unanswered
Brown bear posted this in #help-forum
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
Also created an issue in GitHub: https://github.com/vercel/next.js/issues/51395
Repro link: https://codesandbox.io/p/sandbox/adoring-bartik-66swjf
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
@Brown bear 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
i commented on the issue since it is not a bug.
to disable static site generation, configure it to be dynamic
to disable static site generation, configure it to be dynamic
export const dynamic = 'force-dynamic'