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

Unhandled Runtime Error TypeError: Cannot read properties of null (reading 'clientHeight') #19

Open
mohamadyusuf19 opened this issue Dec 11, 2023 · 4 comments

Comments

@mohamadyusuf19
Copy link

I'm using this library in my NextJS project

Then I got this error:

Unhandled Runtime Error
TypeError: Cannot read properties of null (reading 'clientHeight')

Call Stack
eval
node_modules/react-animation-on-scroll/dist/esm/components/AnimationOnScroll.js (94:0)
eval
node_modules/react-animation-on-scroll/dist/esm/components/AnimationOnScroll.js (155:0)
eval
node_modules/react-animation-on-scroll/dist/esm/components/AnimationOnScroll.js (177:0)
invokeFunc
node_modules/lodash.throttle/index.js (160:0)
leading-edge
node_modules/lodash.throttle/index.js (170:0)
debounced
node_modules/lodash.throttle/index.js (235:0)

Any idea?

@alex-lechner
Copy link

I have the same error in Next 14.

@MetinArslanturk any hint on what this might be?

@alex-lechner
Copy link

It seems that in react-animation-on-scroll/dist/esm/components/AnimationOnScroll.js there's no null check on line 94

const elementBottom = elementTop + node.current.clientHeight; // 'node.current' is possibly 'null'

@kshitijkumarsaini
Copy link

Any workaround on this?

mixartemev added a commit to mixartemev/react-animation-on-scroll that referenced this issue Feb 22, 2024
@mixartemev
Copy link

Any workaround on this?

Any idea?

Yes, I fixed it in my fork: https://github.com/mixartemev/react-animation-on-scroll

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

4 participants