Repository navigation
OpenGraph API route logs "needs to bail out of prerendering" during PPR builds #94636
|
Issue To reproduce
Expected: Actual: Workaround Environment
|
Replies: 2 comments 2 replies
|
I would treat this as an expected static-generation bailout, not as an OpenGraph image failure.
For this route, I think the scoped fix is exactly: // app/api/og/route.tsx
export const dynamic = "force-dynamic"
export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
// generate ImageResponse from searchParams
}That is less blunt than it looks: placed inside If you have So my recommendation would be: keep |
|
Hi, straight up to the fix: module.exports = {
experimental: {
hideLogsAfterAbort: true
}
}I think however, that there's a couple of things going on here, that's worth trying to clarify.
This makes no sense right now. Cache Components is the only config flag, and it is the only reason why you should be seeing this error. Why did you think PPR is enabled by commenting out the dynamic segment config, while keeping cacheComponents optional? The root cause of this is that you likely have: export async function GET(request: Request) {
try {
const { searchParams } = new URL(request.url)
// generate ImageResponse from searchParams
} catch(reason) {
// log the reason
}
}With that flag set, you won't see that prerender bail log anymore. |
Hi, straight up to the fix:
experimental.hideLogsAfterAbortset to true on your next config file. Could you confirm it does the trick?I think however, that there's a couple of things going on here, that's worth trying to clarify.
This makes no sense right now. Cache Components is the only config flag, and it is the only reason why you should be seeing this error. Why did you think PPR is enabled by commenting out the dynamic segment config, while keeping cacheComponents op…