next-optimized-images
next-optimized-images copied to clipboard
TypeError in Canary Img component
First of all, thanks for this module.
I'm currently playing around with the Canary version and the corresponding react-optimized-image
module.
<Img src={require(`publicImages/logo.png`)} webp sizes={[400, 800]} />
Throws an Error:
TypeError: Cannot read property 'fallback' of undefined
at findFallbackImage (.../node_modules/react-optimized-image/lib/components/Img.js:71:14)
I already tried to debug but without the sources being public available this is a little challenging :)
What about making the dependencies of the canary version public
:
- https://github.com/cyrilwanner/next-optimized-images
- https://github.com/cyrilwanner/optimized-images-loader
- ...
Thanks :)
@bezoerb You probably forgot the babelrc settings.
I published a new canary version today which should recognize more use-cases (also styled-components) so I suggest trying that out. A missing babelrc setting could also lead to this error.
Those repositories were lacking documentation so that's why I kept them private. But that has now been resolved and all dependencies are now public.
Thanks @cyrilwanner i'm currently working on another project but i'll try the changes as soon as i get back to it :)