Skip to content

How to handle Dynamic server usage in next build without i18n routing #1551

Closed Answered by amannn
MHMDHIDR asked this question in Q&A
Discussion options

You must be logged in to vote

Error: Dynamic server usage: Route /dashboard/users couldn't be rendered statically because it used headers. See more info here: https://nextjs.org/docs/messages/dynamic-server-error

Your getUserLanguage function relies on reading headers, therefore a page can naturally not be static at the same time—I guess that makes sense. For apps behind a login dynamic rendering is quite common.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MHMDHIDR
Comment options

@amannn
Comment options

Answer selected by MHMDHIDR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants