N
Nuxt3mo ago
Lijah

Routing to another page leads to null parent node error

When converting a Vue app to Nuxt and after following directory and layout structures, routing leads to a null parent node error.
Nuxt - 3.11.1
Vue - Latest
Nuxt - 3.11.1
Vue - Latest
Using both template (NuxtLink) and programatic (router.push) routing, the app throws Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode') All methods fill the URL with the proper routes and I can manually navigate to the pages but for some reason the router does not work. This seemed to be related to this huge GitHub issue https://github.com/nuxt/nuxt/issues/13309 But trying almost all the suggestions, none seem to have worked. I am following the patterns I use in a working Nuxt App I have used in another project. What is more bizzare is that when debugging, I can occasionally get the routing to work between simple pages after waiting for some time or saving small changes. However, when rebooting the server, the routing error happens again.
GitHub
TypeError: Cannot read properties of null (reading 'parentNode') · ...
Environment Operating System: Linux Node Version: v14.18.1 Nuxt Version: 3.0.0-27389502.88da719 Package Manager: yarn@1.22.17 Bundler: Vite User Config: ssr Runtime Modules: - Build Modules: - Repr...
4 Replies
Lijah
Lijah3mo ago
If I manually have the router log all of its routes, everything seems to have mapped correctly as well
sykes10667
sykes106673mo ago
Since the upgrade to vue 3.4.x I am having similar issues. Quite difficult to replicate but for the time being you can lock vue version to the latest one that is working for you
Lijah
Lijah3mo ago
Good call, I'm going to try and downgrade things @sykes10 It's odd because all the posts I see online says this is either fixed or are caused by all sorts of random things, none of which are easy to discover by debugging Shoot. It seems like downgrading to Vue 3.3.4, which is the version that works on my other project, does not work
sykes10667
sykes106673mo ago
For me locking at 3.3.13 works but it might be that there’s something else in your project that is messing things up