-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Page transition error with Vue3-b16: Cannot read _leaveCb property #341
Comments
Transition and KeepAlive usage is still going through and RFC and will likely have a few breaking changes |
Thank you @posva and sorry for re-opening. |
@posva As you mentioned, this is going through RFC yet, but your example does work in 4.0.0-alpha.14 so... is it safe to assume this is already implemented? BC can potentially occur but more or less the syntax/concept is settled? (swapping the way |
Use it if you need it but make sure to pay attention to the changelog for changes :) |
Nice! Thank you very much. |
I managed to make it work by swapping the transition with the route as per your example but couldn't figure out how to make the enter-transition work correctly. Can someone elaborate please? |
@gianniskarmas There is no more <router-view v-slot="{ Component, props }">
<transition
enter-from-class="-translate-x-24 opacity-0"
enter-active-class="transition duration-200 transform"
enter-to-class="translate-x-0 opacity-100"
leave-from-class="translate-x-0 opacity-100"
leave-active-class="transition duration-200 transform"
leave-to-class="translate-x-24 opacity-0"
>
<component :is="Component" v-bind="props" />
</transition>
</router-view> Here is the RFC explaining the change: vuejs/rfcs#105 |
Thank you so much @Aferz, that explains it perfectly. |
2022-08-12, I also encountered this problem too with nuxt3. |
@shtse8 did you solve it ? I'm not using any transitions in my nuxt3 app. |
no, it happens in dev mode and randomly crash with this error, but luckily working fine in production. |
Hmm ok, I do the same and it seems to crash after every other hot reload. |
same thought, it happens most while routing. |
Hot reloading it is for me - experienced with Nuxt 3.0.0-rc.8 + Nuxt 3.0.0-rc.9 |
@posva this should not be closed. the error still exists. |
Also happening to me with Nuxt 3.0.0-rc.9 |
It's also happening to me with Nuxt 3.0.0-rc.4 |
I managed to solve the problem in my Nuxt3 application, I'll leave the report here in case it helps someone: There was a page in my application that rendered a component that had a v-if and checked two refs, if it didn't meet the condition it would go to the v-else component, as in this example below:
I had a button with a function in the onClick event in my component to toggle the ref to show the component on v-else, when I was toggling my ref from true to false, I was having the issue. Here is the solution that I found, In the first component where I have the v-if, there was another component inside that received one of the refs as props and I was checking if it existed before rendering it to not generate a break, so what I did was basically this:
I removed the ref from the first condition and created a new v-if in the child component. |
I seem to be having the exact same issue now, not using nuxt though, just vite and vue.
I've tried many different things but the error keeps popping up when I am trying to directly navigate/reload on a subpage |
Experiencing reading '_leaveCb' error on hot reload with Nuxt 3.5.3 too |
Also experiencing this error on hot reload with Nuxt 3.6.5. Since it's happening to others not necessarily using Nuxt I'm not sure how useful my details are but in my case it's happening on the only Page that uses a Layout. Disabled transitions for now to make the errors go away |
error still there |
same error with nuxt 3.10. Removing page transitions works fine.. |
This issue still exists with nuxt 3.13.2. Disabling transitions solves it. Why is this closed? |
same here still having this issue in 3.13.2.
|
Version
4.0.0-alpha.13
Reproduction link
https://codesandbox.io/s/fancy-shadow-04mrv?file=/package.json
Steps to reproduce
You can see the error within the reproduction link while changing routes
What is expected?
Page transition to work as expected
What is actually happening?
Cannot read _leaveCb property
As Evan You commented here (vitejs/vite#482 (comment)) this is liekly a vue-router Vue 3 issue.
Can you please have a look?
The text was updated successfully, but these errors were encountered: