You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your route.js / route.ts likely needs to force dynamic rendering.
export const dynamic = "force-dynamic";
Otherwise during the build process. Next will try and pre-render that page. That means it calls APIs, needs process.env, etc. It will do this even though route.* would lead you to believe it's a server side route.
📚 CodePosts with questionable syntax decisions🏷 ToolsTools so good they get their own shoutout🏷 TypeScriptType All The Things!
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Your
route.js
/route.ts
likely needs to force dynamic rendering.export const dynamic = "force-dynamic";
Otherwise during the build process. Next will try and pre-render that page. That means it calls APIs, needs
process.env
, etc. It will do this even thoughroute.*
would lead you to believe it's a server side route.Source: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
Beta Was this translation helpful? Give feedback.
All reactions