Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Layout whit child and useAsync data cannot read 'parentNode' #25694

Closed
luca-smartpricing opened this issue Feb 8, 2024 · 3 comments
Closed

Comments

@luca-smartpricing
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v20.11.0
  • Nuxt Version: 3.10.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: yarn@4.0.1
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-ktie5u?file=pages%2Fpage-one.vue

Describe the bug

If you have 2 different layout and one of them has one child with useAsyncData (or maybe a general fetch?) if you go from the first page with layout default to the second page with another-lyout and come back, it throw this error: TypeError: Cannot read properties of null (reading 'parentNode') and broke all my website.

Additional context

No response

Logs

chunk-ZFKCPPMZ.js?v=9a8b1d1e:1503 [Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core . 
  at <RouterView name=undefined route=undefined > 
  at <NuxtPage> 
  at <Other ref=Ref< Proxy(Object) {…} > > 
  at <LayoutLoader key="other" layoutProps= {ref: RefImpl} name="other" > 
  at <NuxtLayoutProvider layoutProps= {ref: RefImpl} key="other" name="other"  ... > 
  at <NuxtLayout> 
  at <App key=3 > 
  at <NuxtRoot>
warn$1 @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1503
logError @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1709
handleError @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1701
callWithErrorHandling @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1653
flushJobs @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1858
Promise.then (async)
queueFlush @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1767
queueJob @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1761
(anonymous) @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:7571
resetScheduling @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:513
triggerEffects @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:557
triggerRefValue @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1310
set value @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1355
finalizeNavigation @ vue-router.js?v=3f89114f:2563
(anonymous) @ vue-router.js?v=3f89114f:2473
Promise.then (async)
pushWithRedirect @ vue-router.js?v=3f89114f:2441
push @ vue-router.js?v=3f89114f:2367
navigate @ vue-router.js?v=3f89114f:1621
callWithErrorHandling @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1651
callWithAsyncErrorHandling @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1659
invoker @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:10254
Show 20 more frames
Show less
chunk-ZFKCPPMZ.js?v=9a8b1d1e:9626 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode')
    at parentNode (chunk-ZFKCPPMZ.js?v=9a8b1d1e:9626:30)
    at ReactiveEffect.componentUpdateFn [as fn] (chunk-ZFKCPPMZ.js?v=9a8b1d1e:7537:11)
    at ReactiveEffect.run (chunk-ZFKCPPMZ.js?v=9a8b1d1e:430:19)
    at instance.update (chunk-ZFKCPPMZ.js?v=9a8b1d1e:7577:17)
    at callWithErrorHandling (chunk-ZFKCPPMZ.js?v=9a8b1d1e:1651:32)
    at flushJobs (chunk-ZFKCPPMZ.js?v=9a8b1d1e:1858:9)
parentNode @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:9626
componentUpdateFn @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:7537
run @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:430
instance.update @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:7577
callWithErrorHandling @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1651
flushJobs @ chunk-ZFKCPPMZ.js?v=9a8b1d1e:1858
Show 6 more frames
Show less
Copy link

stackblitz bot commented Feb 8, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@danielroe
Copy link
Member

I think this can be tracked in #21901.

It's a Vue bug that will likely be fixed soon 🤞

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
@luca-smartpricing
Copy link
Author

It was fixed in Vue 3.4.20 vuejs/core#10098 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants