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

TypeError: Cannot destructure property 'parentNode' of 'this.placeholderEl' as it is undefined #36

Open
STsaruk opened this issue May 30, 2020 · 2 comments

Comments

@STsaruk
Copy link

STsaruk commented May 30, 2020

when I try to disable sticky when resizing to mobile v-sticky="!isMobile" - an error appears:

vue.esm.js?a026:628 [Vue warn]: Error in directive sticky componentUpdated hook: "TypeError: Cannot destructure property 'parentNode' of 'this.placeholderEl' as it is undefined."

@STsaruk
Copy link
Author

STsaruk commented May 30, 2020

it was my mistake, I defined the variable on the mounted hook instead of created, but, I think, the directive needs to be secured with additional checks so that such an error does not occur in any case

@isuke01
Copy link

isuke01 commented Mar 11, 2021

Funny store I have same error but I dont have anything hooked with hooks.
I just tried to use in on nuxt and when I come from page without sticky element to page with it this error appear ;)
Code is just missing some checks like if element exists and (typeof el.getBoundingClientRect === "function")
It was in my case by double iF
I had

<aside v-if="pageHasSidebar">
<floatingMenu v-if="pageHasFloatingMenu"></floatingMenu>
....
</aside>

I changed second v-if to v-show and looks it fixed the issue. But I'd preffer to use v-if ...

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

No branches or pull requests

2 participants