Touch scrolling causing 'deltaX is not defined at HTMLDivElement.onTouchMove' error accumulation
kilimanjjjaro opened this issue · 2 comments
Hello, I'm having an issue when scrolling with the touch screen gesture, the console throws the following error, and it's constant, every time the scroll is modified, the error keeps accumulating.
Uncaught ReferenceError: deltaX is not defined at HTMLDivElement.onTouchMove (webpack-internal:///(:3000/app-client)/./node_modules/.pnpm/@studio-freight+lenis@1.0.9/node_modules/@studio-freight/lenis/dist/lenis.modern.mjs:5:2699)
I'm testing it from Chrome dev tools by selecting the iPhone SE device, but it happens with all devices that have touch enabled instead of normal scrolling. I am wrapping the children in my root layout using the ReactLenis component like this:
export default function RootLayout ({ children }: ChildrenInterface): JSX.Element {
return (
<html lang='en' className='dark'>
<head>...</head>
<body className='bg-white dark:bg-black transition-colors duration-400 ease-in-out antialiased'>
<SWRConfig value={{ revalidateOnFocus: false }}>
<AppProvider>
<NavBar />
<AnimatePresence>
<ReactLenis root options={{ duration: 1.2 }}>
{children}
</ReactLenis>
</AnimatePresence>
<Toaster position='top-center' toastOptions={{ className: 'ui-notifications' }} duration={5000} />
<Footer />
</AppProvider>
</SWRConfig>
</body>
</html>
)
}
I am using the following:
Next JS: 13.2.4
@studio-freight/react-lenis: 0.0.15
This also happens in production. I hope you can find the problem, thank you.
Hello @kilimanjjjaro, i've just pushed an updated version seems like the issue was coming from lenis and it was reported and fixed there, so i've just updated the lenis version and everything should be good now, thanks for your patience.
Yes, it was fixed with the update. Thank you very much, Franco!