isotope-packery
isotope-packery copied to clipboard
Error: No Layout mode: packery
Hi!
I get the below message using 2.0.1
but not 2.0.0
:
No Layout mode: packery
I'm bundling Isotope in a Nuxt.js app which uses Webpack with the following syntax:
const Isotope = require('isotope-layout');
require('isotope-packery');
const iso = new Isotope(el, options);
I've dug around the commit history and haven't been able to figure out what changed in the patch version update - do you have any idea?
Many thanks, James
Thanks for reporting this issue. Could you try just requiring isotope-packery
?
const Isotope = require('isotope-packery');
const iso = new Isotope(el, options);
Thanks for the suggestion, I've just tried it but no luck. I'm now getting:
client.js:522 TypeError: Cannot read property 'packery' of undefined
at Mode.LayoutMode (layout-mode.js:38)
Inspecting the source it seems the LayoutMode function is being passed an element rather than the isotope instance:
// layout mode class
function LayoutMode( isotope ) {
this.isotope = isotope; // <-- added breakpoint here and confirmed `isotope` is an element (the container)
// link properties
if ( isotope ) {
this.options = isotope.options[ this.namespace ];
this.element = isotope.element;
this.items = isotope.filteredItems;
this.size = isotope.size;
}
}
Does that help at all?
I'll have to take a look at the issue here.
Same issue here v2.0.0 and 2.0.1 with isotope v3.0.0 and 3.0.6
I think it may be due to the load order of the packery, i have this issue suddenly when I changed my js load order.
I was able to get this working by doing:
import Isotope from 'isotope-layout'
import 'isotope-packery'
const isotope = new Isotope(...)