Uncaught TypeError: Cannot read property 'option' of undefined
Hi,
I'm using version 2.0.5, and initializing the script via HTML with the following options:
{"cellAlign":"left","cellSelector":".block","prevNextButtons":false,"watchCSS":true,"groupCells":true}
and I get the following error:
Uncaught TypeError: Cannot read property 'option' of undefined
which is related to the following lines:
if ( this.element.flickityGUID ) {
var instance = instances[ this.element.flickityGUID ];
instance.option( options );
return instance;
}
In our case, the this.element.flickityGUID variable is equal to 1 but the instances object is emtpy.
Could you please look into this? Thanks!
I'm sorry to see you're having trouble with Flickity. Could you provide a reduced test case? See Submitting Issues in the contributing guidelines.
Hey there, I discovered what the issue was: by accident, I was importing the Flickity .js file twice, and that generated the error. Removing one of the two resources fixed the error.
It might be worth investigating a little bit this particular case, though, since it would occur again the moment you include an external library, or plugin, that is also using Flickity for some reason.
Thanks for following up.