N
Nuxt2w ago
Inès

Stop fetching favico on every request

Hi, How could I prevent fetching every request twice, once with the actual data I'm looking for, and once again looking for the favicon file? I should mention that I am using a layout that uses useSeoMeta as follows: const favicon = getPathTo('/favicon.svg') useSeoMeta({ ogType: 'website', ogLocale: locale, ogLocaleAlternate: locales, ogImage: favicon }) Using Nuxt@3.11.2, and issue occurs on Chrome (haven't tried other browsers atm). Issue also arises on a dynamic page (My pages folder contains a file with a dynamic name [slug].vue). Having those double requests actually causes issues on server side (500 error code) on repeat... Thanks in advance!
No description
6 Replies
manniL
manniL2w ago
did you set up the favicon app-wide?
Inès
Inès2w ago
Well I set it in nuxt.config.ts as follows: export default defineNuxtConfig({ app: { head: { link: [ { rel: 'icon', type: 'image/svg', href: './favicon.svg' } ] } }, Is there aynthing else I should do? Maybe worth mentioning, in my app I only have dynamic pages. Given that I have the following pages structure: -pages -list -[slug].vue And that I also use nuxt-i18n with a prefix strategy, I end up with URLs like: MY-APP-URL/en/list/name Then, when I navigate to one of those pages in the browser, it triggers a json request (that I can see on the Network tab) with the following url construction: MY-APP-URL/en/list/favicon.svg
manniL
manniL2w ago
but you want MY-APP-URL/favicons.svg, right?
Inès
Inès2w ago
Right in the nuxt.config? I'll try that in a few minutes and let you know
manniL
manniL2w ago
no no I mean, your favicon is not in "./favicon.svg" but "/favicon.svg" so try this 🙂
Inès
Inès2w ago
Oh right 👀 haven't noticed the extra dot, damn, will try that right away!! Works perfectly! Many thanks @manniL always good to have someone to see with brand new 👀 !
Want results from more Discord servers?
Add your server
More Posts
Extend NuxtUI Form ComponentI'm using Nuxt UI and I want to extend the UForm component, to always scrol lthe first error into viNuxt does not render updated content after buildI've integrated WordPress for blogs on our site. At the time of build, the blogs that are already thWARN [nuxt] useAsyncData should return a value that is not null or undefined or the request may beWith the latest update i get this multiple times, but there is no way to see which code is the causeDirective v-debounceHello! I have been trying for a while to create a custom directive debounce.ts in Nuxt without succBest way to cache a pre-rendered SSG project?Hello! Currently I am working in a project that aims to prerender using data from a Database around I get an error connected with nuxtui-pro that text-foreground class doesn' t exist in module[2:17:00 AM] ERROR Pre-transform error: [postcss] /node_modules/.pnpm/@nuxt+ui-pro@1.3.1_nuxt@3.11NuxtUI , keep Horizontal Nav Bar item active for multiple routesLet's take for example I have a horizontal route in a shared layout, and I have a route names `docs`nuxt project was working fine 1 month ago now fails on `pnpm run build` prerenderI'm getting many > Error: [500] without more information on the cause or error causing this. The buQuestion about netlify deploymentHey guys… just curious why nuxt docs for deploying to netlify say netlify will automatically set theJsonTokenOke so im trying to implement a video player that can only be accessed when having a jsonwebtoken c