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

[Bug Report][3.4.20] Uncaught (in promise) TypeError: Cannot read properties of null (reading 'da') #10415

Closed
AlexLavoie42 opened this issue Feb 26, 2024 · 4 comments · Fixed by #10417
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: suspense

Comments

@AlexLavoie42
Copy link

Vue version

3.4.20

Link to minimal reproduction

https://stackblitz.com/edit/nuxt-starter-14ccdj

Steps to reproduce

Navigate back and forth

What is expected?

No errors

What is actually happening?

Error that breaks the application and blocks navigation.

System Info

No response

Any additional comments?

This is an attempt to reproduce this error: TypeError: Cannot read properties of null (reading 'suspenseId')

I have been getting this in my production Nuxt application after upgrading from 3.4.8 to 3.4.20. Unfortunately I could not reproduce the exact error, but this seems to have a similar root cause (component is undefined when we try to access one of its properties. I can also confirm that both of these errors go away when downgrading to 3.4.8.

This also only appears when you have keepalive enabled.

@edison1105
Copy link
Member

edison1105 commented Feb 27, 2024

This is an attempt to reproduce this error: TypeError: Cannot read properties of null (reading 'suspenseId')

I think this error has been fixed via #10184
will be fixed by #10417

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'da')

This is because the KeepAlive cached vnode is not mounted. so there is nothing to do with KeepAlive.

This also only appears when you have keepalive enabled.

Without KeepAlive also has the problem see simple reproduction of current issue

@AlexLavoie42
Copy link
Author

This is an attempt to reproduce this error: TypeError: Cannot read properties of null (reading 'suspenseId')

I think this error has been fixed via #10184

I do not believe so, as my application breaks with this error once updating from 3.4.8 to 3.4.20. Unfortunately I couldn't find an exact reproduction but I think it is somewhat related to using the dynamic route name param in a computed variable that is used in other components, since deleting that specifically causes the error to go away.

@AlexLavoie42
Copy link
Author

if (newBranch.shapeFlag & ShapeFlags.COMPONENT_KEPT_ALIVE) {
suspense.pendingId = newBranch.component!.suspenseId!
} else {

Here is where the error happens to give some context. This if statement gets triggered while newBranch.component is null

@AlexLavoie42
Copy link
Author

Fortunately I can confirm that adding the changes done in #10417 fixes the TypeError: Cannot read properties of null (reading 'suspenseId') in my application as well!

@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. and removed scope: keep-alive labels Feb 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: suspense
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants