From 8a53564f61d414ad00ad6dbe995f141c4319b0fa Mon Sep 17 00:00:00 2001 From: Adebesin Tolulope Date: Thu, 9 Apr 2026 07:59:12 +0100 Subject: [PATCH 1/4] fix: pass query params to OG image ISR function on Vercel Vercel's ISR `passQuery` defaults to `false`, which strips all query parameters before passing the request to the serverless function. This caused the compare page OG image to always render the empty state because the function never received `packages=zustand,redux` or the `_query` parameter that nuxt-og-image relies on. Closes #2431 Co-Authored-By: Claude Opus 4.6 (1M context) --- nuxt.config.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index d206d0824..a18132dc1 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -128,7 +128,12 @@ export default defineNuxtConfig({ '/api/registry/package-meta/**': { isr: 300 }, '/:pkg/.well-known/skills/**': { isr: 3600 }, '/:scope/:pkg/.well-known/skills/**': { isr: 3600 }, - '/__og-image__/**': getISRConfig(3600), + '/__og-image__/**': { + isr: { + expiration: 3600, + passQuery: true, + }, + }, '/_avatar/**': { isr: 3600, proxy: 'https://www.gravatar.com/avatar/**' }, '/opensearch.xml': { isr: true }, '/oauth-client-metadata.json': { prerender: true }, From b828bceda672215a6acad76792b18586e1a94575 Mon Sep 17 00:00:00 2001 From: Adebesin Tolulope Date: Thu, 9 Apr 2026 08:12:55 +0100 Subject: [PATCH 2/4] fix: add allowQuery whitelist for OG image ISR cache Restrict cache variation to only the query params the OG handler needs, preventing cache fragmentation from arbitrary query params. Co-Authored-By: Claude Opus 4.6 (1M context) --- nuxt.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/nuxt.config.ts b/nuxt.config.ts index a18132dc1..5db7f21bb 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -132,6 +132,7 @@ export default defineNuxtConfig({ isr: { expiration: 3600, passQuery: true, + allowQuery: ['packages', '_query'], }, }, '/_avatar/**': { isr: 3600, proxy: 'https://www.gravatar.com/avatar/**' }, From 2dd81c26ec3d0fd861ac7a220087778639106c21 Mon Sep 17 00:00:00 2001 From: Adebesin Tolulope Date: Thu, 9 Apr 2026 20:39:02 +0100 Subject: [PATCH 3/4] fix: scope query passthrough to compare OG image route only Keep the default ISR config for all other OG images and only enable passQuery + allowQuery for the compare page OG image route. Co-Authored-By: Claude Opus 4.6 (1M context) --- nuxt.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 5db7f21bb..b80700e7f 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -128,7 +128,8 @@ export default defineNuxtConfig({ '/api/registry/package-meta/**': { isr: 300 }, '/:pkg/.well-known/skills/**': { isr: 3600 }, '/:scope/:pkg/.well-known/skills/**': { isr: 3600 }, - '/__og-image__/**': { + '/__og-image__/**': getISRConfig(3600), + '/__og-image__/image/compare/**': { isr: { expiration: 3600, passQuery: true, From bc19494e293d3f86eaf9a7b1c3a627948d432256 Mon Sep 17 00:00:00 2001 From: Adebesin Tolulope Date: Thu, 9 Apr 2026 20:40:37 +0100 Subject: [PATCH 4/4] fix: sort packages in OG image to normalize cache keys Sorting ensures ?packages=zustand,redux and ?packages=redux,zustand produce the same OG image URL and share one ISR cache entry. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/pages/compare.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/compare.vue b/app/pages/compare.vue index 46819fb47..9c4a4d2fe 100644 --- a/app/pages/compare.vue +++ b/app/pages/compare.vue @@ -140,7 +140,7 @@ async function exportComparisonDataAsMarkdown() { } defineOgImageComponent('Compare', { - packages: () => packages.value, + packages: () => packages.value.toSorted((a, b) => a.localeCompare(b)), emptyDescription: () => $t('compare.packages.meta_description_empty'), })