Aljullu / react-lazy-load-image-component

React Component to lazy load images and components using a HOC to track window scroll position.
https://www.npmjs.com/package/react-lazy-load-image-component
MIT License
1.46k stars 110 forks source link

Updating to 1.5.2 causes error #98

Closed chazsolo closed 2 years ago

chazsolo commented 2 years ago

Bug description Upgrading to 1.5.2 causes a webpack error to be thrown. 1.5.1 works just fine with our webpack version 4.41.6

Uncaught TypeError: __webpack_modules__[e] is not a function
    at __webpack_require__ (vendor-React.f420156d1dc70973bea8.js:2:1)
    at Object.react (vendor-React.f420156d1dc70973bea8.js:2:1)
    at __webpack_require__ (vendor-React.f420156d1dc70973bea8.js:2:1)
    at eval (LazyLoadImage.jsx:5:63)
    at Object../src/components/LazyLoadImage.jsx (vendor-React.f420156d1dc70973bea8.js:2:1)
    at __webpack_require__ (vendor-React.f420156d1dc70973bea8.js:2:1)
    at eval (index.js:7:87)
    at Object../src/index.js (vendor-React.f420156d1dc70973bea8.js:2:1)
    at __webpack_require__ (vendor-React.f420156d1dc70973bea8.js:2:1)
    at vendor-React.f420156d1dc70973bea8.js:2:1

To Reproduce

Update to 1.5.2 and run app using the package

Technical details:

TimLehner commented 2 years ago

@Aljullu I believe there is a discrepancy between the source code and the published package. If I take my fork (updated to 1.5.2) and npm run build my build/index.js is quite different. For example, there are various references to console.log in the build directory. I think you accidentally published a development build that wasn't committed.

@chazsolo in the interim, you can use @timlehner/react-lazy-load-image-component. src

Aljullu commented 2 years ago

My bad. :man_facepalming:

Should be fixed now, can you test again @chazsolo and @TimLehner?

TimLehner commented 2 years ago

That seems to all be working now, thanks @Aljullu. I've removed my fork on npmjs

chazsolo commented 2 years ago

Yes, works for me! Thanks @Aljullu for your quick response!