question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Route navigation with NuxtLink only visible after page is refreshed

See original GitHub issue

Environment

❯ npx nuxi info Nuxt CLI v3.0.0-rc.3 08:12:45 RootDir: /home/projects/nuxt-content-v2-blog-demo 08:12:47 Nuxt project info: 08:12:47


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.3
  • Package Manager: npm@7.17.0
  • Builder: vite
  • User Config: modules, components
  • Runtime Modules: @nuxt/content@2.0.1
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-content-v2-blog-demo

Describe the bug

Current Behavior

  1. Navigate to “/blog” -> Content for page is visible ✅
  2. Navigate to “/home” or click on any blog post link on this page -> Empty NuxtPage body ❌

Console sometimes show an error, see “Logs” below.

If I refresh the empty page, the content body is shown correctly

Expected Behavior

Page content is visible without refreshing the page

Additional context

No response

Logs

vue.js?v=5d99fb64:7198 Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
    at insert (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:7198:12)
    at move (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:5821:7)
    at move (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:5809:7)
    at move (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:5809:7)
    at move (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:5809:7)
    at Object.activeBranch.transition.afterLeave (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:2303:15)
    at performRemove (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:5923:20)
    at el._leaveCb (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:2917:9)
    at finishLeave (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:7828:13)
    at resolve2 (https://nuxt-content-v2-blog-demo--3000.local.webcontainer.io/_nuxt/node_modules/.vite/deps/vue.js?v=5d99fb64:7859:30)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
harlan-zwcommented, Jun 4, 2022

Not exactly sure what’s going on but I think it may be related to how nuxt does the transitions between pages.

If you wrap the ContentDoc in a div it seems to fix it.

See here: https://stackblitz.com/edit/nuxt-content-v2-blog-demo-npjmnv?file=pages/blog/[...slug].vue

2reactions
harlan-zwcommented, Jul 19, 2022

All the above methods do not work for me.

If you provide a reproduction on stackblitz, I’ll look into it

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Nuxt) Vue component doesn't show up until page refresh
If I navigate to the page manually, or refresh it, the component shows. I've seen this before in Nuxt and am not sure...
Read more >
How do I re-render my index ("/") NuxtLink when already on ...
I want the user to be able to click an icon from the base route page to refresh that page to generate a...
Read more >
The router Property - Nuxt
Setting this to false essentially makes every router-link navigation a full page refresh in IE9. This is useful when the app is server-rendered...
Read more >
ScrollSmoother - refresh after routing - GSAP - GreenSock
On the initial page load everything seems to work fine, but when I navigate to ... in the browser but only when navigating...
Read more >
Vue detect page refresh - Chiara Gabbani
Jan 13, 2022 · To refresh the page on click of a button with JavaScript, ... There are a number of ways to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found