fix: add force-dynamic to API route to prevent build-time OXLO_API_KEY error - #9
Conversation
…Y error Next.js Turbopack evaluates route modules during 'Collecting page data' which triggers the OXLO_API_KEY check. Adding dynamic='force-dynamic' tells Next.js to skip static evaluation for this route entirely.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
OxBot Review
This PR fixes a Next.js build-time failure by adding force-dynamic to the unified API route, preventing static generation when OXLO_API_KEY is unavailable in CI. It also improves the Oxlo client error message and clarifies lazy initialization via JSDoc. Clean, focused fix.
Notes
- The
force-dynamicexport is the correct and minimal fix for API routes that depend on request-time environment variables. Good call catching the build-time static generation issue. - Improving the error message to mention the
x-api-keyheader is a nice UX touch that will help developers self-serve when integrating tools.
Verdict: LGTM | No inline issues found
Automated review by OxBot
There was a problem hiding this comment.
OxBot Review
This PR correctly fixes a Next.js build-time failure by marking the tools API route as force-dynamic, preventing static generation without the OXLO_API_KEY. It also improves the Oxlo client helper to resolve the API key lazily and provides a clearer error message.
Verdict: LGTM | 0 inline comment(s)
Automated code review by OxBot
No inline issues found.
No description provided.