NUXT_B4025

NuxtLink to an unknown route

B4025

A template contains a <NuxtLink> with a static to (or href) that does not match any page route, so following the link would show a 404 page.

This warning is reported unless experimental.templateDiagnostics is disabled. Only static, absolute paths are checked: links with a bound :to, external URLs, relative paths, hash-only and query-only links, and links with the external prop are not. Dynamic route segments and catch-all routes match any value, and paths that a route rule redirects are accepted.

A path that only matches as the prefix of a route is reported: with only app/pages/users/[id].vue, a link to /users has no page to render.

Resolution

Check the path for typos, or add the page it should link to. If the link points at something other than a page (a server route, a file in public/, or another app on the same domain), set the external prop so that it is followed by the browser rather than the Vue router:

<template>
  <NuxtLink
    to="/api/export.csv"
    external
  >
    Download
  </NuxtLink>
</template>
Read more in Docs > API > Components > Nuxt Link.

Was this helpful?