Skip to content

Why my API route.ts is statically rendered ? #62725

Discussion options

You must be logged in to vote

Hi

You should be able to just do export const dynamic = 'force-dynamic' anywhere in the file.

The first link talks about ways to opt-out from the caching, which is the default behavior. The last option listed is called route segment config, and there you'll find the second link, which talks about controlling this via the dynamic export.

You could also activate the Next.js TypeScript plugin, https://nextjs.org/docs/app/building-your-application/configuring/typescript#typescript-plugin, and that'll give y…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@AlexandreBardiaux
Comment options

@ShakChunni
Comment options

@MahidunNobi
Comment options

Answer selected by AlexandreBardiaux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants