question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find image named undefined.png

See original GitHub issue

Getting many of these warnings. Images still show though. Don’t get this with Image.

Could not find image named undefined.png

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mstllccommented, Mar 21, 2017

Yeah I’m seeing this issue as well and I think it’s because of this line: https://github.com/wcandillon/react-native-img-cache/blob/master/src/index.tsx#L101

I actually see render() getting called twice before the component finally has a value at this.state.path, so the built in Image component is throwing this warning when it can’t load undefined.png. I have to think it’s just because RNFetchBlob.fs.exists() is a Promise and it’s delaying anything until the next loop, which is going to miss that first render() call?

For what it’s worth, I don’t think the style prop has anything to do with this issue as mentioned above. All that does is allow RN to determine it doesn’t even need to attempt to load the image because it has no dimensions and won’t be displayed anyways, so the warning is never thrown.

I’m not exactly sure what the right solution is here, but one idea is to allow for passing a placeholder image path that could be set as the initial value of this.state.path so that something is displayed while it pulls the image from cache or downloads the image.

For those who are affected by the warning, you can disable that specific yellow box warning with console.ignoredYellowBox = ['Could not find image'] somewhere near the entry point of your app. This will prevent the yellow box from being displayed, but you’ll still see the warnings in your debugging console.

1reaction
wcandilloncommented, Mar 8, 2017

@kirkstrobeck I ran a couple of tests on IOS and couldn’t reproduce the issue. Is it possible that you experienced the issue on android? Please feel free to re-open if this is the case of if you have more information on how to reproduce the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could Not Find Image File in React Native - Stack Overflow
So in the file it would be a list of requires like this export const imageName = require('./path/to/the/image/imageName.png');.
Read more >
Images - React Native
The image name is resolved the same way JS modules are resolved. ... while check@3x.png will be used on an iPhone 7 Plus...
Read more >
How to obtain a URI for an image asset in React Native (With ...
First, it's CommonJS and we're working on the browser-side of things, where it doesn't really belong, in the end you're using just a...
Read more >
Error Message: There are errors below. Hover over each for ...
File name - If the image file name is longer than 80 characters, including the file extension, the image won't upload into the...
Read more >
ImagePicker - Expo Documentation
The plugin allows you to configure various properties that cannot be set at ... When you run this example and pick an image,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found