Ask questionsUislider already loaded

After I upgrade to noUiSlider 14.0.x and jquery to 3.4.1 I am experiencing a rather strange bug. We use noUISlider on all our sliders on, including here on this page:

However, once every a few dozen to one hundred loads of, we get this error: Uncaught Error: noUiSlider (14.0.2): Slider was already initialized The error is given by any of the sliders on that page, usually not the same one.

The error appears at random, on any browser and I have failed so far to create a working test scenario to reproduce it.

I am not doing anything crazy to the sliders, just create and update. I have also tried to prevent the error by wrapping the slider creation in an if condition but so far without success.

So far I can only conclude that there is a bug either on the server-side (Apache) or in the JS, maybe even the noUiSlider code.

Any support or input will be greatly appreciated.


Answer questions Bllacky

Sure. This is the js that has the noUiSlider code.

And this is how I wrapped the creation in an if:

	noUiSlider.create(document.getElementById('launchdate'), {
		start: [cpumindateset, cpumaxdateset],
		connect: true,
		step: 1,
		direction: 'ltr',
		format: { to: function(value){ return parseInt(value); }, from: function(value){ return parseInt(value); } },
		range: {
			'min': [cpumindate],
			'max': [cpumaxdate]		

I made a few more changes yersterday and I am waiting on user feedback to see if anyone is still getting the error. Since its a random error, it may take a few days until I get confirmation it hasn't creeped up again.


Related questions

No questions were found.
Github User Rank List