tiny-slider icon indicating copy to clipboard operation
tiny-slider copied to clipboard

Can't find variable: exports

Open seldimi opened this issue 2 years ago • 7 comments

After version 2.9.2, each time we use dist or src tiny-slider.js, there following error is on console: Can't find variable: exports

CDN is 2.9.2 so I cannot compare. Any ideas?

seldimi avatar Nov 09 '21 21:11 seldimi

Looks like exports are in a file called browserstack.conf.js.

You can try loading that first however I just added this to the top of the js file. Not 100% sure the consequences to this so I don't recommended it.

var exports = {};

QuestionDevelopment avatar Nov 14 '21 15:11 QuestionDevelopment

I’m sorry I haven’t understood. Following the simple install steps with npm, without any other dependencies tns won’t be useable and we will have to put that initialization array before import?

https://github.com/ganlanyuan/tiny-slider#install

seldimi avatar Nov 14 '21 16:11 seldimi

Try to use tiny-slider.js from dist/min directory

ETNyx avatar Nov 15 '21 18:11 ETNyx

I had the same, it was because I was instantiating the slider carousel inside a jQuery document.ready. Try moving this outside of jQuery.

tadywankenobi avatar Dec 10 '21 10:12 tadywankenobi

I see. But jQuery is widely spread (still) so there should be another workaround. For the time being, I use webpack with dist folder

seldimi avatar Dec 10 '21 12:12 seldimi

Try to use tiny-slider.js from dist/min directory

this is solved my issue thanks

bariscanyilmaz avatar Aug 04 '22 12:08 bariscanyilmaz

Yes using the tiny-slider.js from dist/min directory works, but ... it's the minified version and sometime for debugging the non minified version is useful.

marceloverdijk avatar Sep 23 '22 11:09 marceloverdijk