Giter Site home page Giter Site logo

Comments (17)

kirkstrobeck avatar kirkstrobeck commented on July 27, 2024 1

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.

wcandillon avatar wcandillon commented on July 27, 2024 1

@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.

mstllc avatar mstllc commented on July 27, 2024 1

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.

wcandillon avatar wcandillon commented on July 27, 2024

@kirkstrobeck could you send me a snippet that would allow me to reproduce this bug?

from react-native-img-cache.

kirkstrobeck avatar kirkstrobeck commented on July 27, 2024

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.

wcandillon avatar wcandillon commented on July 27, 2024

@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.

kirkstrobeck avatar kirkstrobeck commented on July 27, 2024

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.

wcandillon avatar wcandillon commented on July 27, 2024

@kirkstrobeck and photos[1] is undefined?

from react-native-img-cache.

dillonykyang avatar dillonykyang commented on July 27, 2024

@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.

dillonykyang avatar dillonykyang commented on July 27, 2024

@wcandillon further debugging - the warning is on only when you provide a style prop to it.

from react-native-img-cache.

wcandillon avatar wcandillon commented on July 27, 2024

@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.

kirkstrobeck avatar kirkstrobeck commented on July 27, 2024

Upgraded, but it seems to still be present. 😭

from react-native-img-cache.

wcandillon avatar wcandillon commented on July 27, 2024

@thorsonmscott Thank you so much for providing this information, I will look into it.

from react-native-img-cache.

wcandillon avatar wcandillon commented on July 27, 2024

@thorsonmscott @kirkstrobeck Can you check version 1.1.8?

from react-native-img-cache.

kirkstrobeck avatar kirkstrobeck commented on July 27, 2024

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.

wcandillon avatar wcandillon commented on July 27, 2024

@kirkstrobeck should be fixed in 1.1.9, sorry about this regression!

from react-native-img-cache.

kirkstrobeck avatar kirkstrobeck commented on July 27, 2024

No worries, that’s what software does. 1.1.9 appears to be fixed. 🎉

from react-native-img-cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.