Is there an existing issue for this?
Vercel Runtime Logs
Current Behavior
The recent addition dynamic base url detection server side introduces an optimization bug whereby NextJS is not able to load the models during static rendering. This bug doesn't seem to affect functionality but it is a performance regression. I'm currently researching alternative approaches.
✓ Collecting page data
Failed to load models: Error: Dynamic server usage: Route / couldn't be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
at y (.next/server/chunks/243.js:19:10449)
at m (.next/server/chunks/622.js:10:26147)
at o (.next/server/chunks/253.js:1:40526)
at n (.next/server/chunks/253.js:1:39524)
at o (.next/server/app/page.js:1:9867)
at stringify (<anonymous>) {
description: "Route / couldn't be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error",
digest: 'DYNAMIC_SERVER_USAGE'
}
All attempts to load models failed, returning empty array
Expected Behavior
Static rendering of models during build time.
Steps To Reproduce
bun run build
Environment
Anything else?
No response
Is there an existing issue for this?
Vercel Runtime Logs
Current Behavior
The recent addition dynamic base url detection server side introduces an optimization bug whereby NextJS is not able to load the models during static rendering. This bug doesn't seem to affect functionality but it is a performance regression. I'm currently researching alternative approaches.
Expected Behavior
Static rendering of models during build time.
Steps To Reproduce
bun run build
Environment
Anything else?
No response