next-rest-framework icon indicating copy to clipboard operation
next-rest-framework copied to clipboard

Error: Dynamic server usage

Open markedwards opened this issue 8 months ago • 1 comments

This is somewhat related to #167, in the sense that this can be alleviated by specifying export const dynamic = "force-dynamic"; in next-rest-framework route handlers.

It looks like there's some call-stack issue where request.headers and request.url usage is generating Next build-time errors.

Error: Dynamic server usage: Route /api/internal couldn't be rendered statically because it used `request.headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
Next REST Framework encountered an error:
Error: Dynamic server usage: Route /api/internal/vertical-ids couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
Next REST Framework encountered an error:
Error: Dynamic server usage: Route /api/internal/brand-ids couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error

markedwards avatar Jul 02 '24 15:07 markedwards