leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.64k stars 658 forks source link

Initialization error with vue3 and nuxt3 #1220

Closed nicopapy closed 1 year ago

nicopapy commented 1 year ago

With the simple integration example given in the documentation, i got this error on page load (i'm using vue3 and nuxt3) :

Uncaught (in promise) ReferenceError: Cannot access 'scope_Self' before initialization at nouislider.ts:2438:25 at Array.forEach (<anonymous>) at nouislider.ts:2435:43 at Array.forEach (<anonymous>) at fireEvent (nouislider.ts:2431:35) at nouislider.ts:2403:17 at Array.forEach (<anonymous>) at bindEvent (nouislider.ts:2402:27) at tooltips (nouislider.ts:1526:9) at setupSlider (nouislider.ts:2999:13)

I have the same integration working in vue2. Any idea ?

leongersen commented 1 year ago

I haven't seen this before. Is your code running before the node in the DOM is ready?

nicopapy commented 1 year ago

No, i'm running the code in the mounted event, when all the dom is ready

mitar commented 1 year ago

It works for me with Vue3. I think you should provide a more complete example.

leongersen commented 1 year ago

Thanks for the feedback @mitar, I'll close this. Feel free to open a new issue with more details if needed.

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.