I just added the Swiper 4.0.2 from the cdnjs. But as soon as I refresh the page, this error shows up on my console.
swiper.js:16 Uncaught TypeError: Cannot set property 'Swiper' of undefined
This is swiper.js line 16:
13 (function (global, factory) {
14 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
15 typeof define === 'function' && define.amd ? define(factory) :
16 (global.Swiper = factory());
17 }(this, (function () { 'use strict';
It seems that global
is undefined.
Can anyone please help?
Thank you.
basically if you're still having this error. You just need to look onto your gulpfile.js under plugin.babel and look at the ignore section and just add swiper.js to the array.
.pipe(plugin.babel({
presets: ['es2015'],
compact: true,
ignore: ['what-input.js','swiper.js']
}))