Skip to content

Some code not executed in production build in Next 14 #70266

Answered by samcx
jira-zz asked this question in Help
Discussion options

You must be logged in to vote

@jira-zz You can force it to be dynamic → https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic.

export const dynamic = 'force-dynamic'

Or, you can add a revalidate if you don't want it to request new data every time → https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate.

export const revalidate = 10

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@samcx
Comment options

Answer selected by jira-zz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
bug Issue was opened via the bug report template. Runtime Related to Node.js or Edge Runtime with Next.js. Pages Router Related to Pages Router.
2 participants
Converted from issue

This discussion was converted from issue #70150 on September 19, 2024 21:24.