Swiper: Cannot set property 'Swiper' of undefined

Created on 24 Oct 2017  路  2Comments  路  Source: nolimits4web/swiper

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:
(global.Swiper = factory());

It seems that global is undefined.
Can anyone please help?

Thank you.

Most helpful comment

Hi @ashussen , 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'] }))

All 2 comments

Your issue is closed because it is not filled correctly. Before you open an issue please review the contributing guideline.

Please fill the issue template correctly and:

  • Clearly describe the issue including steps to reproduce when it is a bug.
  • Make sure you fill in the earliest version that you know has the issue.
  • Live Link or JSFiddle/Codepen or website with isssue

It will save a lot of time for other contributors to check your issue and fix it.

Hi @ashussen , 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'] }))

Was this page helpful?
0 / 5 - 0 ratings