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

VueUse 1.6.0 - Cannot read properties of null (reading 'document') #3543

Closed
7 tasks done
frasza opened this issue Nov 12, 2023 · 1 comment · Fixed by #3544
Closed
7 tasks done

VueUse 1.6.0 - Cannot read properties of null (reading 'document') #3543

frasza opened this issue Nov 12, 2023 · 1 comment · Fixed by #3544

Comments

@frasza
Copy link

frasza commented Nov 12, 2023

Describe the bug

With VueUse 1.6.0 I have got an error that is not present in version 1.5.0.
Error:

nuxt.js:97 [nuxt] error caught during app initialization TypeError: Cannot read properties of null (reading 'document')

In the reproduction I have produced error with using useInfiniteScroll function (found same for useScroll) and it happens because on top of ref element I have an element with conditional rendering.
While testing, I have noticed that if I remove condition for rendering the element, error does not appear.
I have an example where I need the condition to be part of element tree that renders scrolling element and it worked in 1.5.0

Reproduction

https://github.com/frasza/vueuse-nuxt-scroll

System Info

Nuxi info:
------------------------------
- Operating System: Windows_NT
- Node Version:     v20.9.0
- Nuxt Version:     3.8.1
- CLI Version:      3.9.1
- Nitro Version:    2.7.2
- Package Manager:  pnpm@8.9.0
- Builder:          -
- User Config:      modules, ssr, devtools
- Runtime Modules:  @vueuse/nuxt@10.6.0, @nuxtjs/tailwindcss@6.9.4
- Build Modules:    -
------------------------------

Used Package Manager

pnpm

Validations

@joaopslins
Copy link
Contributor

Having the exact same issue here in Vue.

Likely related to this change: #3384

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

Successfully merging a pull request may close this issue.

2 participants