NuxtN
Nuxt2y ago
5 replies
Inès

NuxtLink and SSR pages

Hello,

I have a dynamic page (let's call it A) on my nuxt 3.13 project: ~/pages/networks/[name] that uses useAsyncData and is server-side rendered.
I also have another dynamic page (let's call it B) in the same project, also server-side rendered, in which I have added a NuxtLink that points to the network page:
<NuxtLink to="/networks/networkName"> Name </NuxtLink>

I followed the documentation: https://nuxt.com/docs/api/components/nuxt-link

However, ever since I did that, on click on that link, my page B no longer renders, and I just have an error
error:"[native Error <>Error\n at createError (http://fr.localhost:3002/_nuxt/node_modules/h3/dist/index.mjs?v=cce497c7:78:15)\n at createError (http://fr.localhost:3002/_nuxt/node_modules/nuxt/dist/app/composables/error.js?v=cce497c7:33:21)\n at showError (http://fr.localhost:3002/_nuxt/node_modules/nuxt/dist/app/composables/error.js?v=cce497c7:9:21)\n at Proxy.fetchNetworkData (http://fr.localhost:3002/_nuxt/store/network.ts:65:18)\n at async http://fr.localhost:3002/_nuxt/pages/networks/[name].vue:152:7]"

Am I doing something wrong here? Do NuxtLink work well with server-rendered pages?

I already tried to use the noPrefetch attribute of NuxtLink but it doesn't change anything.
And with a regular <a> tag, navigation works properly.

Many thanks!
Was this page helpful?