Comments (17)
No, *.png
isn’t specified in my code. The ajax data gets .jpg
files. I have a couple local .png
files that I was running thru CachedImage
, but it wasn’t working so now I run them thru Image
. Perhaps uninstalling the app would blow away the cache? but that image isn’t referenced any longer so not sure whats causing this? Looks like the pattern is that whenever I use CachedImage
it warns about an error case from the past and doesn’t forget.
from react-native-img-cache.
@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.
from react-native-img-cache.
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.
from react-native-img-cache.
@kirkstrobeck could you send me a snippet that would allow me to reproduce this bug?
from react-native-img-cache.
I’m not sure that I can without hours of work. Feel free to close as it only produces a warning. Perhaps there can be a check that somewhere says thing must not be undefined
. There is a guard around the image iterator that ensures there is a proper url on my end.
from react-native-img-cache.
@kirkstrobeck Any change you could send me the props to CachedImage
? What is undefined in the props you send to the component?
from react-native-img-cache.
Here is an example. Unfortunately, nothing is undefined. hasImage1
ensures photos[1]
is available.
{
hasImage1
&& <CachedImage
blurRadius={30}
source={{
uri: photos[1],
}}
style={{
bottom: 0,
left: 0,
position: 'absolute',
right: 0,
top: 0,
zIndex: 9,
}}
/>
}
from react-native-img-cache.
@kirkstrobeck and photos[1]
is undefined
?
from react-native-img-cache.
@wcandillon I am also seeing this issue on iOS... just using
<CachedImage source={{uri: item.image_url}} style={{flex:1, resizeMode: 'stretch'}} />
the image_url has a png extension and guaranteed to exist.
from react-native-img-cache.
@wcandillon further debugging - the warning is on only when you provide a style prop to it.
from react-native-img-cache.
@dillonykyang @kirkstrobeck The issue should be fixed in 1.1.7
. Please keep me posted and thank you so much for your help.
from react-native-img-cache.
Upgraded, but it seems to still be present. 😭
from react-native-img-cache.
@thorsonmscott Thank you so much for providing this information, I will look into it.
from react-native-img-cache.
@thorsonmscott @kirkstrobeck Can you check version 1.1.8?
from react-native-img-cache.
Good for a while, then many warnings like
Could not find image named undefined/Users/Foo/Library/Developer/CoreSimulator/Devices/AB229581-586B-40CF-864C-09A66A9A13BF/data/Containers/Data/Application/8C807149-EE98-413A-9DD3-1D5EE79FF3D5/Library/Caches/b253a77b492fc10de6c4c2075c5c17bc2ddee4cd.jpg
This is a regression, because when warnings show, the images do not come thru, so now it’s breaking.
Using 1.1.8
, git clean -xfd
and a simulator reset content and settings iOS.
from react-native-img-cache.
@kirkstrobeck should be fixed in 1.1.9
, sorry about this regression!
from react-native-img-cache.
No worries, that’s what software does. 1.1.9
appears to be fixed. 🎉
from react-native-img-cache.
Related Issues (20)
- hi! You can combine ‘react-native-fit-image’, add Add a function that makes it adaptive? HOT 1
- How can I determine whether the image is already cashed or not
- Is it possible to have a default picture. HOT 1
- support display local image HOT 2
- When add too many Images (At least 800 pictures) on the List, the App will crash! how to solve this question?
- Does it support remote SVG image? HOT 1
- Since immutable === true to execute getpath, what is the meaning of if(immutable === true) in getpath?
- 【We check here if IOS didn't delete the cache content】 what's mean?
- BUg
- How to easily migrate from react-native-fast-image
- Solution to ignore the URI query
- progress indicator is not work HOT 4
- Help! CachedImage in android become blur HOT 3
- [Request] - Please add TTL for cache
- How to load image from SD card?
- CachedImageBackground -- ImageBackground not available on RN 0.45 HOT 2
- React-Native-Fetch-Blob is NOT being maintained HOT 10
- Image doesn't show when the imageName contain spaces [IOS ONLY] HOT 2
- Cannot use with `react-native-fit-image` HOT 2
- ImageCache.getPath will get a wrong extension name while the uri like this:http://example.com/path?param=http%3A%2F%2Fexample.com%2Findex.html%3Ftype%3Dvalue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-img-cache.