lazyload
lazyload copied to clipboard
Cannot set property 'settings' of undefined
I use jquery-lazyload 1.9.7
with reactjs, it works well.
I try to use lazyload 2.0.0-beta.2
with reactjs, I got errors like
Uncaught (in promise) TypeError: Cannot set property 'settings' of undefined
at LazyLoad (lazyload.js:78)
my react component call lazyload like
componentDidMount() {
const images = this.node.querySelectorAll('.lazyload')
lazyload(images, {
threshold: 200,
})
}
I think it should be a bug.
I am using lazyload 2.0.0-beta.2, I encounter the same problem. Comes up with
Cannot set property '_settings' of undefined
I had the same problem and it was because I was not calling properly Lazyload. Initially I was doing this:
var lazyload = require('lazyload.js');
lazyload();
But, what I should do is:
var lazyload = require('lazyload.js');
var obj = new lazyload();
I have same problem, who can solve it
I have same problem in amd.
TypeError: Cannot set property 'settings' of undefined at e (lazyload.min.js?v=1.0.0:formatted:7) at Object.execCb (require.js:1696) at Module.check (require.js:878) at Module.enable (require.js:1176) at Module.init (require.js:788) at callGetModule (require.js:1203) at Object.completeLoad (require.js:1590) at HTMLScriptElement.onScriptLoad (require.js:1717)
Same here. I added the library with requirejs and then:
$('img.lazyload').lazyload();
The error:
lazyload.js:78 Uncaught TypeError: Cannot set property 'settings' of undefined
at LazyLoad (lazyload.js:78)
at Object.execCb (require.js:1650)
at Module.check (require.js:866)
at Module.enable (require.js:1143)
at Module.init (require.js:774)
at callGetModule (require.js:1170)
at Object.completeLoad (require.js:1544)
at HTMLScriptElement.onScriptLoad (require.js:1671)
@spraxis have u found a solution?
Getting the same error here too! Would love to hear if anyone has a solution…
getting same here also.
Same here. Any ideas?
Anyone found a solution yet?
Do not use lazyload()
instead of new lazyload()