i18n and content: No match found for location with path
I use content plugin and i18n plugin together. All markdown links cause the vue router warning
No match found for location with path
.
Other than that, everything works fine. The links are correctly resolved in the browser to open the pages in the currently selected language and not the default language.
I use strategy prefix
Can I do something to
1. Generate links to the correct /{locale}/{...slug}
?
2. Otherwise remove that warning?3 Replies
Hi @tpluscode. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The knowledge sources do not provide a direct solution for suppressing the
The warning
The i18n module allows you to define custom routes and strategies (like
There is no documented way in the sources to suppress this specific Vue Router warning. The warning itself is not harmful if your app works as expected, but it can clutter your console. In other contexts, similar warnings have been addressed in future Nuxt releases or by handling the missing routes/files [Github Issue]. Summary:
- There is no built-in solution in the provided sources to automatically generate locale-prefixed links in markdown rendered by Nuxt Content. - There is no documented way to suppress the
[Vue Router warn]: No match found for location with path
warning when using Nuxt Content and i18n together, nor do they describe a built-in way to automatically generate locale-prefixed links in markdown rendered by Nuxt Content.
However, here are some relevant points from the sources:
1. About the Warning:The warning
[Vue Router warn]: No match found for location with path ...
typically appears when the Vue Router tries to resolve a route that does not exist in your Nuxt app. This can happen if markdown links point to paths that are not registered as routes, or if the i18n strategy changes the expected path structure (e.g., adding a locale prefix) but the link in the markdown does not include it. This is a known issue in Nuxt when certain files or routes are requested but not found, as seen in other contexts such as static files or well-known paths [Github Issue].
2. i18n and Custom Routes:The i18n module allows you to define custom routes and strategies (like
prefix
), and you can map pages to locale-specific paths. However, there is no explicit mention in the sources of an automatic way to rewrite markdown links to include the current locale prefix. You can define custom routes in your i18n config, but this applies to Vue pages, not markdown content [Dynamic routing in Nuxt 3 with I18n].
3. Suppressing the Warning:There is no documented way in the sources to suppress this specific Vue Router warning. The warning itself is not harmful if your app works as expected, but it can clutter your console. In other contexts, similar warnings have been addressed in future Nuxt releases or by handling the missing routes/files [Github Issue]. Summary:
- There is no built-in solution in the provided sources to automatically generate locale-prefixed links in markdown rendered by Nuxt Content. - There is no documented way to suppress the
[Vue Router warn]: No match found for location with path
warning for these cases.
- Your app working correctly despite the warning suggests it's a cosmetic/logging issue rather than a functional one.
Possible Workarounds (not in sources, but for context):
- You might consider processing your markdown links to include the locale prefix, or using a custom renderer for links in Nuxt Content, but this is not covered in the knowledge sources.
If you need a solution strictly based on the knowledge sources, unfortunately, they do not contain enough information to answer your question definitively.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@555413648382623754> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
thanks. I try the content transformer. I see it get s registered (breakpoint hits) but it's not actually being executed...