Closed l0git3k closed 6 years ago
Same issue encountered. I am also debugging just now and spot root for root.jQuery is undefined https://github.com/lokesh/lightbox2/blob/master/src/js/lightbox.js#L27
And wonder this
should be window
? https://github.com/lokesh/lightbox2/blob/master/src/js/lightbox.js#L29
I find that I have a Gulp script to run Babel with es2015 and turn out the script changing the this in https://github.com/lokesh/lightbox2/blob/master/src/js/lightbox.js#L29 to undefined. Would this be the syntax issue?
Same issue encountered here. Anybody found a fix by any chance?
@so-rose for fixing, we need to add option to .babelrc { "modules": false }
.
Because babel 5 when transpiling *.js files, replace all this
with undefined
@mugukamil Thanks for the fix!
Glad this issue was sorted out. Closing. Thanks to everyone who helped. 👏
Hi there, I am having the same issue. I applied the solution mentioned above to change Babelrc option, but it didn't work for me. Babelrc option 'modules:false' stopped GridderJs on the site.
Is there any other solution out there?
Hello,
I'm trying to use Lightbox2 with a Zurb Foundation 6 project and after add the CSS and JS files I get this error on all pages :
Uncaught TypeError: Cannot read property 'jQuery' of undefined at lightbox.js:25 at lightbox.js:14
My jQuery version is the 2.2.4 and the lightbox.js is concat at the bottom of app.js