scaleflex / js-cloudimage-responsive

Cloudimage Responsive will smartly resize, compress and accelerate images across the World in your site for all devices. The plugin supports lazy loading technique with fancy animation on image load. Any questions or issues, please report to https://github.com/scaleflex/js-cloudimage-responsive/issues
Other
68 stars 15 forks source link

Cannot read property 'style' of undefined #12

Closed pfranck closed 7 months ago

pfranck commented 4 years ago

I am using the js-cloudimage-responsive plugin in a Nuxt.js project. It has been working flawlessy until I wanted to add an image in there without using the cloud image plugin. I tried to get in the version without css, however the documentation that is provided leaves me with the error that the correct package is not installed. The error I'm getting is the following: Uncaught TypeError: Cannot read property 'style' of undefined at CIResponsive.onPreviewWithRatioImageLoad (ci.service.js?c31a:457)

It only occurs once a background image is loaded that is not using the plugin

dzmitry-stramavus commented 4 years ago

hey @pfranck ,

The JS version of the plugin is manipulating DOM in real-time. The team is not very familiar with how Vue.js can handle these problems. As far as I know, Vue.js has lots of escape hatches available to allow for non-Vue JavaScript that also touches the DOM. You would help us by creating a demo project or codesandbox example to show the problem and so that we can adapt our JS plugins for it.

TimTilroy commented 4 years ago

Hi,

We are having the same issue on some images. We use the plugin on a lot of places but simetimes we see this error in the console. When looking which line causes this it is: b.style.background = "transparent",

Effect is that the blurred loader image is not removed and keeps showing behind the "normal" image. Weird thing is that it is reproducable but not always.

We are using V6 of the plugin btw.

Any ideas?

Regards