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

Install via NPM return error Uncaught ReferenceError: noUiSlider is not defined but via CDN works fine #1233

Closed Geovanek closed 8 months ago

Geovanek commented 1 year ago

I installed it via NPM in laravel and imported:

import nouislider from 'nouislider';
window.noUiSlider = nouislider;

And this way does not work, it returns: Uncaught ReferenceError: noUiSlider is not defined

But if I import via: <script src="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/15.6.1/nouislider.min.js"></script>

It works perfectly. What could be happening to not work via NPM?

image

leongersen commented 1 year ago

It really depends on how you're building your JS. There isn't enough info here for me to answer this.

github-actions[bot] commented 7 months 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.