Gerbuuun
Gerbuuun
Explore posts from servers
NNuxt
Created by null on 9/29/2024 in #❓・help
Nuxt UI Pro Student offer
Did you read the FAQ?
12 replies
NNuxt
Created by null on 9/29/2024 in #❓・help
Nuxt UI Pro Student offer
https://ui.nuxt.com/pro/pricing you can read it in the FAQ on this page
12 replies
NNuxt
Created by Baljeet Singh on 9/20/2024 in #❓・help
runtimeConfig not working when website deployed to netlify
Then I don't know, sorry.
26 replies
NNuxt
Created by Baljeet Singh on 9/20/2024 in #❓・help
runtimeConfig not working when website deployed to netlify
Have you tried NUXT_YOUTUBE_API_KEY?
26 replies
NNuxt
Created by JJ on 9/18/2024 in #❓・help
Is there an equivalent to unstable_after() in h3?
Seems like it. I’ve never used h3 object syntax
8 replies
NNuxt
Created by JJ on 9/18/2024 in #❓・help
Is there an equivalent to unstable_after() in h3?
8 replies
NNuxt
Created by JJ on 9/18/2024 in #❓・help
Is there an equivalent to unstable_after() in h3?
event.waitUntil
8 replies
NNuxt
Created by Rakan Alahmadi on 8/26/2024 in #❓・help
navigateTo weird behavior
If this fixed your problem, could you mark this as solved? It would help other people who might have the same problem
5 replies
NNuxt
Created by Rakan Alahmadi on 8/26/2024 in #❓・help
navigateTo weird behavior
I'm assuming you're using it like so: navigateTo('notification/example'). This is a relative path. You need to add a / to the front: navigateTo('/notification/example')
5 replies
NNuxt
Created by Hendrik Jan on 7/30/2024 in #❓・help
Can you extend H3EventContext?
I place this in a types.d.ts at the root of my project
4 replies
NNuxt
Created by Hendrik Jan on 7/30/2024 in #❓・help
Can you extend H3EventContext?
You should do it like this:
declare module 'h3' {
interface H3EventContext {
// your types here
}
}
declare module 'h3' {
interface H3EventContext {
// your types here
}
}
No need to import any h3 types for this if you are using nuxt
4 replies
NNuxt
Created by thunderbird7756 on 7/12/2024 in #❓・help
i18n with NuxtUI component
Items here is not reactive. You need to make it a computed value
2 replies
NNuxt
Created by Gerbuuun on 3/23/2024 in #❓・help
Nuxt Module `runtimeConfig` types.
I gave up lol
8 replies
NNuxt
Created by Gerbuuun on 4/21/2024 in #❓・help
Typescript nested generic resolves to unknown
In the end I actually went with this:
export default function useTranslation() {
const { locale } = useI18n();

type Translatable<K, T> = K & { translations: Record<string, T> };
function translate<T, K>(data: Translatable<T, K>) {
const { translations, ...rest } = data;
const definedLocales = computed(() => Object.keys(translations));
const translation = computed(() => definedLocales.value.includes(locale.value) ? translations[locale.value] : translations[definedLocales.value[0]]);
const result = computed(() => ({ ...rest, ...translation.value }));

return toReactive(result);
}

return {
translate,
};
}
export default function useTranslation() {
const { locale } = useI18n();

type Translatable<K, T> = K & { translations: Record<string, T> };
function translate<T, K>(data: Translatable<T, K>) {
const { translations, ...rest } = data;
const definedLocales = computed(() => Object.keys(translations));
const translation = computed(() => definedLocales.value.includes(locale.value) ? translations[locale.value] : translations[definedLocales.value[0]]);
const result = computed(() => ({ ...rest, ...translation.value }));

return toReactive(result);
}

return {
translate,
};
}
It is a translate composable which uses the current locale given by Nuxt i18n. I tried function translate<T>(data: { translations: Record<string, T> }) but that resolved to object instead. See final options on typescript play
7 replies
NNuxt
Created by Artist201 on 4/24/2024 in #❓・help
Vercel Vs Cloudflare
I have not heard many good things about Vercel analytics. Very expensive for little data. Also, can't beat Cloudflares $5/month value (and free tier). I see Cloudflare as a more beginner friendly AWS. Vercel is just an upcharge on AWS.
15 replies
NNuxt
Created by Gerbuuun on 4/21/2024 in #❓・help
Typescript nested generic resolves to unknown
Somehow missed that option. Thanks!
7 replies
NNuxt
Created by Gerbuuun on 4/21/2024 in #❓・help
Typescript nested generic resolves to unknown
Here is a reproduction with more context. I have created three solutions but only one does what I want: https://stackblitz.com/edit/vitejs-vite-xkeyve?file=src%2Fmain.ts
7 replies
NNuxt
Created by Gerbuuun on 3/23/2024 in #❓・help
Nuxt Module `runtimeConfig` types.
Also, the server handlers do not exist when I try to call them in my project...
8 replies
NNuxt
Created by Gerbuuun on 3/23/2024 in #❓・help
Nuxt Module `runtimeConfig` types.
It does not recognise runtimeConfig.mollie:
Argument of type 'unknown' is not assignable to parameter of type 'IgnoredInput | Input'.
Argument of type 'unknown' is not assignable to parameter of type 'IgnoredInput | Input'.
This is literally a copy from the Nuxt documentation
8 replies
NNuxt
Created by Gerbuuun on 12/25/2022 in #❓・help
useFetch adds null to return type
Ok, I thought when using SSR this wouldn't be a problem. So how would I check the data for null? The example given at the top doesn't do anything. Do I need to wrap it in a computed or anything?
9 replies