You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Sentry logs keep getting a type error pointing to this library. It seems that it is saying that an object (html) doesn't exist. Wondering what the cause of this could be. We are using create-react-app, no SSR. The only thing I can think is that there are several of these sections and the images are lazy loaded - but why would that affect it? Any thoughts?
It looks like there's a TypeError in the react-animation-on-scroll library. The error message says that O.current.clientHeight is null and cannot be accessed. The error happened on line 159 of ../node_modules/react-animation-on-scroll/src/components/AnimationOnScroll.tsx.
Proposed Solution
To fix this issue, you need to make sure that the O.current object is not null before trying to access its clientHeight property. One way to do this is by adding a null check before accessing the property. Here's an example of what the fixed code could look like:
const elementBottom = O.current ? elementTop + O.current.clientHeight : 0;
You should add this change directly to the AnimationOnScroll.tsx file, at line 159.
To prevent this issue from happening in the future, make sure to always check for null or undefined values before accessing their properties. You can also use TypeScript or other static type checkers to catch these errors before runtime.
The text was updated successfully, but these errors were encountered:
Hello,
Our Sentry logs keep getting a type error pointing to this library. It seems that it is saying that an object (html) doesn't exist. Wondering what the cause of this could be. We are using
create-react-app
, no SSR. The only thing I can think is that there are several of these sections and the images are lazy loaded - but why would that affect it? Any thoughts?Sentry Logs Screenshot
Usage
Problem Description
It looks like there's a TypeError in the react-animation-on-scroll library. The error message says that O.current.clientHeight is null and cannot be accessed. The error happened on line 159 of ../node_modules/react-animation-on-scroll/src/components/AnimationOnScroll.tsx.
Proposed Solution
To fix this issue, you need to make sure that the O.current object is not null before trying to access its clientHeight property. One way to do this is by adding a null check before accessing the property. Here's an example of what the fixed code could look like:
const elementBottom = O.current ? elementTop + O.current.clientHeight : 0;
You should add this change directly to the AnimationOnScroll.tsx file, at line 159.
To prevent this issue from happening in the future, make sure to always check for null or undefined values before accessing their properties. You can also use TypeScript or other static type checkers to catch these errors before runtime.
The text was updated successfully, but these errors were encountered: