NuxtLink - prefetch / noPrefetch
Yo Kapa
I have this often in my console :
The thing is neither of them are anywhere in my code.
I use Nuxt UI and MDC, can it be from them for some reason ?
I use nuxt 4 and nuxt ui 4
6 Replies
Hi @Omnislash. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The warning
This warning is triggered when both
[NuxtLink] 'prefetch' and 'noPrefetch' cannot be used together. 'noPrefetch' will be ignored. appears when both the prefetch and noPrefetch props are set on a <NuxtLink>, which is not allowed. According to the Nuxt 4 documentation, you should only use one of these props at a time—using both will cause one to be ignored and trigger this warning. This is also explicitly mentioned in the docs for the rel and noRel attributes, which have similar mutual exclusivity rules for their props, and the same logic applies to prefetch and noPrefetchNuxtLink rel and noRel attributes.
If you are not directly using these props in your code, it is possible that a component from Nuxt UI or another library (like MDC) is wrapping or extending <NuxtLink> and passing both props, either explicitly or through default prop merging. The Nuxt UI Link component exposes both prefetch and noPrefetch props, so if a parent or wrapper component is setting defaults or merging props, this could result in both being set unintentionallyNuxt UI Link API.
To resolve this:
- Check if you are using any custom wrappers or higher-order components around <NuxtLink> or the Nuxt UI Link component that might be merging or spreading props.
- Review your usage of Nuxt UI and MDC components to see if they internally use <NuxtLink> and might be passing both props.
- If you find a component or library doing this, you may need to open an issue with that library or adjust your usage to ensure only one of the props is set.
If you cannot find any such usage in your codebase, it is likely coming from a dependency. In that case, you can try updating your dependencies or reporting the issue to the relevant library maintainers.
Summary:This warning is triggered when both
prefetch and noPrefetch are set on a <NuxtLink>. Even if you don't set them directly, a library or wrapper component (such as from Nuxt UI or MDC) might be doing so. Check your dependencies and any custom wrappers for this patternNuxtLink rel and noRel attributes, Nuxt UI Link API.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@305772639438503936> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai I didn't wrap it and didn't write it
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the official Nuxt 4 documentation, the warning
[NuxtLink] 'prefetch' and 'noPrefetch' cannot be used together. 'noPrefetch' will be ignored. is triggered when both props are set on a <NuxtLink>, even if unintentionally. The documentation does not mention Nuxt UI or MDC specifically, nor does it provide details about third-party libraries causing this issue. It only describes the behavior and configuration of <NuxtLink> and its props, including how to globally enable or disable prefetching in your nuxt.config file and how the props interact with each other NuxtLink Props NuxtLink rel and noRel attributes.
The knowledge sources do not contain enough information to confirm whether Nuxt UI or MDC are responsible for this warning, nor do they provide troubleshooting steps for this specific scenario. If you have not written or wrapped any code that sets these props, the cause may be within a dependency, but this cannot be confirmed from the provided documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@305772639438503936> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai I just ctrl+f in my code NuxtLink and prefetch, couldn't find any prefetch on any nuxtlink
it gave up :/