szobi
szobi
NNuxt
Created by szobi on 7/10/2024 in #❓・help
Problem with envs in docker
Now in defineNitroPlugin config is undefined and nuxt get me
[nitro] [unhandledRejection] TypeError: Cannot read properties of undefined (reading 'runtimeConfig')
[nitro] [unhandledRejection] TypeError: Cannot read properties of undefined (reading 'runtimeConfig')
in console
2 replies
NNuxt
Created by szobi on 9/21/2023 in #❓・help
I18n change translations
we decide to fetch snippets at build time and push to [lang].json
5 replies
NNuxt
Created by Furnaxe on 6/8/2023 in #❓・help
Problem with my form
try
throw new ErrorEntity('')
throw new ErrorEntity('')
instead of pomise reject
3 replies
NNuxt
Created by szobi on 5/9/2023 in #❓・help
error with nuxi upgrade using pnpm
nope, l resolved it by remove pnpm-lock, node modules and manually change nuxt version in package.json
3 replies
NNuxt
Created by Merite on 4/12/2023 in #❓・help
I got this error after upgrading from nuxt 3.3.3 to nuxt 3.4.0 how can I fix this
hmm mayve nuxi cleanup to clear a cache
7 replies
NNuxt
Created by Merite on 4/12/2023 in #❓・help
I got this error after upgrading from nuxt 3.3.3 to nuxt 3.4.0 how can I fix this
3.4 has so many bugs, l decided to downgrade and waiting on 3.4.1
7 replies
NNuxt
Created by szobi on 3/28/2023 in #❓・help
nuxt instance unavailable during fetch data
l had two case one when request was nasted in pinia store method ( setup setting)
const getProduct = async (
slug: string | number,
expectedType: EProductType,
options: CustomFetchOptions | null = null,
) => {
const { $sdk } = useNuxtApp()
opinions.value = []

const courseStore = useCourses()
isProcessing.value = true
try {
const response = await $sdk.api.products(
options || {
query: { slug },
},
)
product.value = response.data
if (product.value?.type !== expectedType) {
throw new Error('Product type is not expected ')
}

// herre error
// await getProductOpinion()
} catch (err) {
errorHandler(err)
} finally {
isProcessing.value = false
}
}
const getProduct = async (
slug: string | number,
expectedType: EProductType,
options: CustomFetchOptions | null = null,
) => {
const { $sdk } = useNuxtApp()
opinions.value = []

const courseStore = useCourses()
isProcessing.value = true
try {
const response = await $sdk.api.products(
options || {
query: { slug },
},
)
product.value = response.data
if (product.value?.type !== expectedType) {
throw new Error('Product type is not expected ')
}

// herre error
// await getProductOpinion()
} catch (err) {
errorHandler(err)
} finally {
isProcessing.value = false
}
}
and solved it by move getProductOpinion to try catch in page vue
try {
await productStore.getProduct(route.params.slug, EProductType.SINGLE)
productStore.getProductOpinion()
} catch (e) {
showError({ statusCode: EErrorStatus.ERROR_404, statusMessage: 'Pages Not Found' })
}
try {
await productStore.getProduct(route.params.slug, EProductType.SINGLE)
productStore.getProductOpinion()
} catch (e) {
showError({ statusCode: EErrorStatus.ERROR_404, statusMessage: 'Pages Not Found' })
}
secound case is move try catch from function getCourse() to try catch in script setup root
7 replies
NNuxt
Created by less on 3/30/2023 in #❓・help
how to refetch and reload only component after deleting
can you write more information?
2 replies
NNuxt
Created by zeeshansiddique_ on 3/27/2023 in #❓・help
Form library for Nuxt 3 with validations and dynamic classes ?
3 replies
NNuxt
Created by szobi on 3/28/2023 in #❓・help
nuxt instance unavailable during fetch data
any solutions? 🥺
7 replies
NNuxt
Created by szobi on 3/28/2023 in #❓・help
nuxt instance unavailable during fetch data
aah and its getProductOpinion method
const getProductOpinion = async (loadMore = false) => {
const { opinionsItemPage } = useAppConfig()
if (loadMore && isLastOpinionPage.value) return
try {
const response = await $sdk.api.opinionsByProductId(product.value.id, {
query: {
per_page: opinionsItemPage,
page: loadMore ? opinionsMeta.value.currentPage + 1 : 1,
},
})
opinionsMeta.value = response.meta
opinions.value = [...opinions.value, ...response.data]
} catch (err) {
errorHandler(err)
}
}
const getProductOpinion = async (loadMore = false) => {
const { opinionsItemPage } = useAppConfig()
if (loadMore && isLastOpinionPage.value) return
try {
const response = await $sdk.api.opinionsByProductId(product.value.id, {
query: {
per_page: opinionsItemPage,
page: loadMore ? opinionsMeta.value.currentPage + 1 : 1,
},
})
opinionsMeta.value = response.meta
opinions.value = [...opinions.value, ...response.data]
} catch (err) {
errorHandler(err)
}
}
7 replies
NNuxt
Created by szobi on 3/23/2023 in #❓・help
useCookie set bad max-age expires
any ideas?
3 replies