Mario-Duarte / react-image-zooom

Simple React component that will allow users to zoom in on your images, perfect for product images and galleries!
https://mario-duarte.github.io/react-image-zooom/
27 stars 7 forks source link

TypeError: Cannot read properties of undefined (reading 'nodeName') #2

Closed wal-nagama closed 1 year ago

wal-nagama commented 2 years ago

Facing this issue with internal dependency. Please help. Have already tried upgrading and downgrading node versions.

TypeError: Cannot read properties of undefined (reading 'nodeName') setup node_modules/js-image-zoom/js-image-zoom.js:186

 183 |     data.sourceImg.element = container.children[0];
  184 | 
  185 |     // if sourceImg is not an img (might be a picture element), try to find one
> 186 |     if (data.sourceImg.element.nodeName !== "IMG") {
  187 |         data.sourceImg.element = data.sourceImg.element.querySelector('img');
  188 |     }
  189 | }
Mario-Duarte commented 2 years ago

Thanks for bringing this to my attention, I will look into updating all dependencies.

Mario-Duarte commented 2 years ago

@wal-nagama could you please let me know the version of node you are currently using?