-
Notifications
You must be signed in to change notification settings - Fork 733
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
error: this.$refs.sideNav is undefined #5372
Comments
Could this be a Vue bug? Or are we not respecting the component lifecycle? My understanding is that as long as we do the following, we shouldn't encounter
I see what you mean that checking for |
Parent component waits for all children to be mounted before it mounts itself so if I can understand that right, Agree that it would be worth investigating what's happening at this particular place in detail to be sure what's the problem exactly at first (and hopefully this will help us to understand all similar problems if anything like that occurs in the future again) - I cannot understand this behaviour either yet. Will try if I am able to replicate this somehow. |
^^^^
|
Hmm but when I'm thinking about this "destroyed" part, destroy hooks won't be probably even called when redirecting to a new page in this way. |
That's what I would have assumed too, but the docs say that |
Yes, most nav items should just be basic
I don't think it's destroyed in the Vue component lifecycle sense. My understanding is that on a browser navigation event, JS execution simply "stops" and I wouldn't expect our code to handle any additional events or try to execute anything else. |
Yes, you're right, I realized later that we're not dealing with navigation within one app in this case.
Good to know! I read that all children are mounted before the parent in the past but totally missed that it could happen that it might not finish in time. Thanks for the reference. |
Fixed in #8317 |
Observed behavior
Observed in Sentry
This event has only occurred one time, so it does not appear to be prevalent.
It appears that some event & timing logic is causing us to try and access a
$ref
when it doesn't exist.It's possible that this relates to unsafe combined use of
$watch
,$nextTick
, andwindow.addEventListener
.Expected behavior
The event logic should be defined in such a way that we don't try to access undefined references. If that is not possible, we should at least and a conditional to check for existence before access
User-facing consequences
none known
Errors and logs
Steps to reproduce
unknown
Context
0.12.1
The text was updated successfully, but these errors were encountered: