Route navigation with NuxtLink only visible after page is refreshed
See original GitHub issueEnvironment
❯ 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
- Navigate to “/blog” -> Content for page is visible ✅
- 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:
- Created a year ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
If you provide a reproduction on stackblitz, I’ll look into it