Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defineOgImageComponent with dynamic values not working #190

Closed
Zafiiovskiy opened this issue Apr 5, 2024 · 1 comment
Closed

defineOgImageComponent with dynamic values not working #190

Zafiiovskiy opened this issue Apr 5, 2024 · 1 comment

Comments

@Zafiiovskiy
Copy link

Hi! trying to make defineOgImageComponent work with dynamic data that I get from CMS api in OnMonted for Nuxt3.

useSeoMeta({ description: () => descriptionMeta.value, })

the () => prop for useSeoMeta is working great for me but unfortunately defineOgImageComponent does not work like that and creates an image with emty or default values even if i give it ref or computed properties.

Do you know any way to make it work?

@harlan-zw
Copy link
Collaborator

Hey, thanks for the issue.

from CMS api in OnMonted for Nuxt3.

OG Image data needs to be defined within the Server Side response, if your data is only available onMounted then it will always be empty as this is only called on the client side. useSeoMeta would be showing you the right thing when you inspect the HTML but the SSR response still wouldn't have the meta (try view the page source).

You'll need to fetch the data top-level to fix this, if you still have issues please make a reproduction.

@harlan-zw harlan-zw closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
n0099 added a commit to n0099/open-tbm that referenced this issue Aug 6, 2024
…y `devalue` due to passing refs as props of `defineOgImageComponent()`: nuxt-modules/og-image#190 in `usePostsSEO()` @ index.ts

* replace references to type `UserProvision` with new type `PartialUserProvision` to remove unused function `renderUsername()` in `useSchemaOrg()` @ schemaOrg.ts
@ post/seo

* remove unnecessary `Number.toString()` in `toUserRoute()` @ user.ts
@ utils
@ fe
n0099 added a commit to n0099/open-tbm that referenced this issue Aug 25, 2024
…t/nuxt#28446

* fix class `ms-1` only occurs on not-2th username @ `<PostBadgeThreadAuthorAndLatestReplier>`
- prop `expandRowByClick` of `<ATable>` @ <PostRendererTable>`

* widden the type of param `name` of `routeNameWithCursor()` and guard it against `assertRouteNameIsStr()` to be like `routeNameWithoutCursor()`
* only return the modified route name and param `cursor` without any parts like `query` or other params from param `route` @ `getNextCursorRoute()`
@ router.ts

* fix regression of 0917db2 as `defineOgImageComponent()` now seem being able to `unref()` internally: nuxt-modules/og-image#190 @ post/seo/index.ts
@ utils
@ fe
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

No branches or pull requests

2 participants