Closed benoitdelorme closed 9 months ago
You mean calling lenis.start()
throws this error ? Can you provide a codesandbox ? It seems you're trying to change a private property of Lenis.
It might comes from how you use Lenis in your implementation since it works as expected here https://codesandbox.io/p/sandbox/small-cdn-yk9cqy?file=%2Fsrc%2FApp.js%3A8%2C16
i have the same problem. It happens when i call the functions start() and stop()
this is the sandbox: https://codesandbox.io/p/live/4825f9e6-107a-408c-8a57-aa5a1e22db81
I can't access your codesandbox @plcdnl
I'm facing the same issue when calling start()
and stop()
. It seems to happen from Lenis v1.0.35, because v1.0.34 works fine on my end.
I think it comes from this commit, where private properties have been introduced.
According to the MDN Docs about Private Fields, I would suggest accessing these private class properties using this.#isStopped
instead of this.isStopped
for example : https://github.com/darkroomengineering/lenis/blob/main/packages/lenis/src/index.ts#L276
(I'm using Nuxt 3.10.2)
Why is this happening only with nuxt ?
Good question, have you tested it in a vanilla js environment ?
Why is this happening only with nuxt ?
https://codesandbox.io/p/devbox/lenis-nuxt-bug-tfdzlp
here the sandbox. Sorry!
I can't access your sandbox either @clementroche
It seems like codesandbox make draft private by default now
here is @thiervoj : https://codesandbox.io/p/sandbox/small-cdn-yk9cqy?file=%2Fsrc%2FApp.js
can you try outside of defineNuxtPlugin ?
can you try outside of defineNuxtPlugin ?
https://codesandbox.io/p/devbox/lenis-nuxt-bug-forked-9kkc6c?
Ok found, it happens with vue reactive/refs. With simple vars it works without problems
ok that's not ideal anyway, thank you for your feedback, I must find a better way to handle it imo. Imma revert to previous way.
Thank you for your work!
Thank you!
It's fixed in v1.0.37
Describe the bug I use Lenis in my Nuxt3-Lenis module and since I updated with the latest version of Lenis I have an error when I'm using lenis.start() and lenis.stop(). It worked with version 1.0.27
I tried to fix it but without much success.