Next.js Attempting to Pre-Render route.ts Files #114
thecodedrift
announced in
TIL
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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