Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in Canary Img component #167

Open
bezoerb opened this issue Jun 30, 2020 · 3 comments
Open

TypeError in Canary Img component #167

bezoerb opened this issue Jun 30, 2020 · 3 comments

Comments

@bezoerb
Copy link

bezoerb commented Jun 30, 2020

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:

Thanks :)

@brandonpittman
Copy link

@bezoerb You probably forgot the babelrc settings.

@cyrilwanner
Copy link
Owner

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.

@bezoerb
Copy link
Author

bezoerb commented Jul 22, 2020

Thanks @cyrilwanner
i'm currently working on another project but i'll try the changes as soon as i get back to it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants