-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
throw TypeError when unmounting Teleport after hydration #11400
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
Comments
|
@edison1105 |
The same issue is occurring with my product as well. After switching through different Vue versions, I confirmed that it does not occur in version 3.4.31 but does occur in version 3.4.32. |
We experience the same in our Nuxt application. Navigation between pages without a layout and a page with a layout breaks in vue 3.4.32 and 3.4.33 but works as expected in 3.4.31. Instead of page content getting replaced when navigating, the app changes the browser URL but the content of the old page remains while console contains the error mentioned in this issue. |
The new core/packages/runtime-core/src/components/Teleport.ts Lines 73 to 74 in 422ef34
So, the error in this issue is thrown when the core/packages/runtime-core/src/components/Teleport.ts Lines 274 to 277 in 422ef34
This breaks the navigation from server-rendered pages with a teleport. |
Adding a condition to Teleport tag mitigates the issue, like |
Is it okay to just add a null check in the remove function? if (target) {
- hostRemove(targetStart!)
- hostRemove(targetAnchor!)
+ if (targetStart) hostRemove(targetStart)
+ if (targetAnchor) hostRemove(targetAnchor)
} |
Vue version
3.4.32
Link to minimal reproduction
https://stackblitz.com/edit/github-5tkgxx?terminal=devhttps://stackblitz.com/edit/github-wszpet
Steps to reproduce
What is expected?
No error when redirecting
What is actually happening?
throw type error and unable to redirect
System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.20.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: vue: ^3.4.32 => 3.4.32
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: