Kittensmakemesmile
Kittensmakemesmile
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
You're the best! Thanks!
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
I see! Thanks for that you're amazing! For those that may find this later here is what I have learned: definePageMeta (https://nuxt.com/docs/guide/directory-structure/pages/#page-metadata) has nothing to do with the page metadata, at least from what I gather from the docs, in fact, they have an example that shows that defining SEO data inside of it will cause an error
<script setup lang="ts">
import { someData } from '~/utils/example'

const title = ref('')

definePageMeta({
title, // This will create an error
someData
})
</script>
<script setup lang="ts">
import { someData } from '~/utils/example'

const title = ref('')

definePageMeta({
title, // This will create an error
someData
})
</script>
What I wanted to use was useSeoMeta
useSeoMeta({
title: product?.value.title,
description: product?.value.description,
ogImage: product?.value.image,
ogDescription: product?.value.description,
url: "https://nuxtjs.org",
});
useSeoMeta({
title: product?.value.title,
description: product?.value.description,
ogImage: product?.value.image,
ogDescription: product?.value.description,
url: "https://nuxtjs.org",
});
https://nuxt.com/docs/api/composables/use-seo-meta Which produces the expected results.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
Everything else can be removed, I don't really care, I just want the fetch to work as it should.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
There isn't any more detail than that.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
To the point that the app crashes even when I;m not on the page.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
It does that but it throws an error saying that "product" is undefined.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
That's it.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
It should called the API and render the details of the call into the page.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
Without an error.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
I just want to get the products to render on the page, it's not that deep for me tbh.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
I honestly didn't have much of a plan really, I'm new to nuxt 3 and the compostion api and seeing how things work.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
To define the page meta dynamically.
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
Can you share your fork with updated code?
21 replies
NNuxt
Created by Kittensmakemesmile on 7/26/2023 in #❓・help
Nuxt 3 says 'product' is not defined but it is.
That doesn't seem to work for me. https://stackblitz.com/edit/nuxt-starter-nwtucc
21 replies