Fabian B.
Fabian B.
Explore posts from servers
NNuxt
Created by Fabian B. on 8/9/2024 in #❓・help
VSCode Typechecking very slow: Takes up to 20s
Found the issue – I upgraded drizzle and it decreased the type performance. After downgrading it, it works.
2 replies
NNuxt
Created by dbh! on 6/16/2024 in #❓・help
Does anyone know if @canplaythrough is still a valid listener to use on a `<video /> ` element?
Sounds great 🙂
8 replies
NNuxt
Created by dbh! on 6/16/2024 in #❓・help
Does anyone know if @canplaythrough is still a valid listener to use on a `<video /> ` element?
Yeah I see, unfortunately, there is no native way of lazy loading videos. But you could add a short script that listens to the scroll event and when the video is inside the video, start rendering it.
8 replies
NNuxt
Created by dbh! on 6/16/2024 in #❓・help
Does anyone know if @canplaythrough is still a valid listener to use on a `<video /> ` element?
Is there a reason you don't want to use the autoplay attribute on the <video>?
8 replies
NNuxt
Created by dbh! on 6/16/2024 in #❓・help
Does anyone know if @canplaythrough is still a valid listener to use on a `<video /> ` element?
Hi there! From your implementation, it looks like the video can never start to load, because you do not render it (isLoading is true on component load).
8 replies
NNuxt
Created by Flo on 4/11/2024 in #❓・help
Preserve types in custom useFetch composable?
😄 True, though $fetch.create does not have the same methods such as $fetch, but if it works for your case than it's perfect!
13 replies
NNuxt
Created by Flo on 4/11/2024 in #❓・help
Preserve types in custom useFetch composable?
Just saw your messages, yeah that would have been the way I would have gone too
13 replies
NNuxt
Created by Flo on 4/11/2024 in #❓・help
Preserve types in custom useFetch composable?
No description
13 replies
NNuxt
Created by Nenad Novakovic on 4/5/2024 in #❓・help
How to infer the type from `useAsyncData`?
Happy to help 🙂
8 replies
NNuxt
Created by JC on 4/5/2024 in #❓・help
:class not reactive when using SSR
Can you try to do :class="{ 'the-header--logged-in': currentUser.value }"> (adding .value)
3 replies
NNuxt
Created by brandondeo on 4/5/2024 in #❓・help
entry file size is 2MB+, and by far the longest load time in the app. How can we optimize this?
And then either remove them or for example lazy load them
3 replies
NNuxt
Created by brandondeo on 4/5/2024 in #❓・help
entry file size is 2MB+, and by far the longest load time in the app. How can we optimize this?
You can run nuxi analyze and see which modules are the largest one in your bundle size
3 replies
NNuxt
Created by Nenad Novakovic on 4/5/2024 in #❓・help
How to infer the type from `useAsyncData`?
This is because you cannot select an array item if the possible value is something like [...] | null | undefined
8 replies
NNuxt
Created by Nenad Novakovic on 4/5/2024 in #❓・help
How to infer the type from `useAsyncData`?
So NonNullable<typeof products.value>[number] should work in your case
8 replies
NNuxt
Created by Nenad Novakovic on 4/5/2024 in #❓・help
How to infer the type from `useAsyncData`?
You have to also wrap it in a NonNullable<> before you try to access the array with [number]
8 replies
NNuxt
Created by IamSebastn on 3/1/2024 in #❓・help
Intercepting Routes
Hey there! You can do this with nested routes: https://nuxt.com/docs/guide/directory-structure/pages#nested-routes The way it works is you have a parent page component that is displayed when the modal is closed. (in your case /). Then, when navigating to /modal , the child route gets loaded, which could open the modal.
3 replies
NNuxt
Created by Alberto on 2/29/2024 in #❓・help
Fetch method Not Allowed, but works in other clients
405 means that the HTTP method is not allowed. When you do a fetch or $fetch (which I would suggest) without configuration, it performs a GET request. However, when visiting https://api.fxer.net/api/trial in the browser, you get an 405 Method not allowed. This means you likely need to do a POST or check their documentation.
const response = await $fetch('https://api.fxer.net/api/trial')

// ...
const response = await $fetch('https://api.fxer.net/api/trial')

// ...
Read more about $fetch https://nuxt.com/docs/api/utils/dollarfetch
34 replies
NNuxt
Created by Fabian B. on 2/29/2024 in #❓・help
Reactive Route Search Query Composable
However, if someone has developed something like this that works better, I would be happy to try it out!
3 replies
NNuxt
Created by Fabian B. on 2/29/2024 in #❓・help
Reactive Route Search Query Composable
I solved it by just using useRoute().query.q and navigateTo({ query: { ...useRoute().query, q: '...' } }) directly in my components. I wanted to avoid it to reduce boilerplate, but it seems like it comes with too many issues.
3 replies
NNuxt
Created by Reinier Kaper on 7/30/2023 in #❓・help
@nuxtjs/robots, defineNuxtConfig option `robots` is not recognized
You can try to regenerate your types by removing the .nuxt folder in your project root. Can you show us your nuxt.config.ts?
5 replies