Skip to content

Conversation

@danielroe
Copy link
Member

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs.npmx.dev Error Error Feb 6, 2026 11:35pm
npmx.dev Error Error Feb 6, 2026 11:35pm

Request Review

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/pages/package/[[org]]/[name].vue 0.00% 2 Missing ⚠️
app/pages/index.vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This pull request migrates from the Open Graph image API defineOgImageComponent to defineOgImage across multiple Vue pages, changing title and description parameters from function-based lazy evaluation to direct string values. It upgrades nuxt-og-image from 5.1.13 to 6.0.0-beta.15, adds @takumi-rs/core 0.67.0 as a dependency, updates the ogImage renderer configuration to 'takumi', changes the og-image route prefix from /__og-image__/** to /_og/** in nuxt.config.ts, removes the rebuild step from the postinstall script, and updates test expectations to reflect new component naming conventions.

Possibly related PRs

  • PR #1035: Directly conflicts/coordinates with changes to the postinstall script in package.json where the pnpm rebuild step is removed.
  • PR #962: Modifies the same routeRules entry for the og-image endpoint and ISR configuration in nuxt.config.ts.
  • PR #933: Introduces the OgImage package component and defineOgImageComponent API that this PR replaces with the new defineOgImage approach.
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description references a specific upstream GitHub issue related to nuxt-og-image, which directly corresponds to the pull request's objective of upgrading to nuxt-og-image v6.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/og-image-6

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Comment on lines +173 to 177
defineOgImage('Default', {
title: `~${username.value}`,
description: results.value ? `${results.value.total} packages` : 'npm user profile',
primaryColor: '#60a5fa',
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor: results.value is async, so OG description will likely always be 'npm user profile'.

results from useNpmSearch won't have resolved when defineOgImage is evaluated during SSR, so the ternary will always take the fallback branch. If showing the package count in the OG image was intentional, this is a regression from the previous function-wrapped approach. Otherwise, the fallback is perfectly sensible.

Comment on lines +147 to 151
defineOgImage('Default', {
title: `@${orgName.value}`,
description: packageCount.value ? `${packageCount.value} packages` : 'npm organization',
primaryColor: '#60a5fa',
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

nuxt-og-image v6 defineOgImage reactivity

💡 Result:

In nuxt-og-image v6, defineOgImage() should be treated as non-reactive by default: it sets the OG meta once at the time you call it (during setup / SSR). So if you pass values that change later on the client, crawlers won’t see those updates anyway (they only read the initial HTML), and your tags won’t update unless you call defineOgImage() again. [1]

Recommended pattern (SSR-safe)

Fetch/compute the data before calling defineOgImage() (e.g. await useAsyncData(...), then call it with the resolved values). This is also how the docs show it for Content-driven pages. [2]

If you truly need “reactivity” (client-side navigation)

Re-run it when inputs change:

const route = useRoute()

watchEffect(() => {
  defineOgImage('NuxtSeo', {
    title: route.meta.title ?? 'Default',
  })
})

When the options/props change, nuxt-og-image generates a different OG image URL (and caches by those inputs), so re-calling it with new values is the intended way to “update” the OG image definition. [3]

Sources: defineOgImage API docs [1], Nuxt Content integration example [2], caching/invalidation behavior [3].

[1] https://nuxtseo.com/docs/og-image/api/define-og-image
[2] https://nuxtseo.com/docs/og-image/integrations/content
[3] https://nuxtseo.com/docs/og-image/guides/cache


🏁 Script executed:

cat -n app/pages/org/[org].vue | head -60

Repository: npmx-dev/npmx.dev

Length of output: 2030


🏁 Script executed:

sed -n '140,160p' app/pages/org/[org].vue

Repository: npmx-dev/npmx.dev

Length of output: 853


🏁 Script executed:

grep -n "useOrgPackages" app/pages/org/[org].vue

Repository: npmx-dev/npmx.dev

Length of output: 128


🏁 Script executed:

find . -name "*.ts" -o -name "*.js" -o -name "*.vue" | xargs grep -l "export.*useOrgPackages" | head -5

Repository: npmx-dev/npmx.dev

Length of output: 100


🏁 Script executed:

cat -n app/composables/npm/useOrgPackages.ts

Repository: npmx-dev/npmx.dev

Length of output: 6789


🏁 Script executed:

grep -n "emptySearchResponse" app/composables/npm/useNpmSearch.ts | head -5

Repository: npmx-dev/npmx.dev

Length of output: 259


🏁 Script executed:

sed -n '47,53p' app/composables/npm/useNpmSearch.ts

Repository: npmx-dev/npmx.dev

Length of output: 207


🏁 Script executed:

grep -n "defineOgImage\|watchEffect" app/pages/org/[org].vue

Repository: npmx-dev/npmx.dev

Length of output: 91


The OG image description will always show 'npm organisation' instead of the actual package count.

useOrgPackages uses useLazyAsyncData, which does not block page setup and defaults to returning an empty emptySearchResponse (with objects: []). When defineOgImage is called during setup, packageCount.value will be 0, causing the ternary to always resolve to the fallback text.

According to the nuxt-og-image v6 documentation, defineOgImage() is non-reactive and should be called only after data is available. To fix this, either await the data before calling defineOgImage, or use watchEffect to re-call it once the lazy data resolves:

watchEffect(() => {
  defineOgImage('Default', {
    title: `@${orgName.value}`,
    description: packageCount.value ? `${packageCount.value} packages` : 'npm organisation',
    primaryColor: '#60a5fa',
  })
})

Comment on lines +110 to 114
defineOgImage('Default', {
title: `${pkg.value?.name ?? 'Package'} - Docs`,
description: pkg.value?.license ?? '',
primaryColor: '#60a5fa',
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Same async-data concern as package-code/[...path].vue.

pkg.value is fetched asynchronously via usePackage, so title and description will resolve to their fallbacks ("Package - Docs" and "") if the data hasn't loaded when defineOgImage is evaluated. See the verification on the package-code file for the same pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant