Skip to content

Require .avif Image not work: None of these files exist... #1064

@erie-e9

Description

@erie-e9

Describe the bug
I just tested local images, .avif, .png and .webp formats, only avif format is facing problems. All of them are working fine coming from server.

To Reproduce
Use this package with local .avif image.
Note: This was tested only on iOS simulator, cannot test it on Android devices yet.

<FastImage
        // attempt 1
           source={require('./profile.avif')}

        // attempt 2
        // source={{
            //  uri: Image.resolveAssetSource(require('@assets/shared/images/profile.avif')).uri,
        // }}

        // attempt 3
           //source={{ uri: Image.resolveAssetSource(require('./profile.avif')).uri }}

         resizeMode={FastImage.resizeMode[resizeMode || 'contain']}
         style={{
           width: 40, height: 40, borderRadius: 30, padding: 10,
          }}
      />

Expected behavior

  • Should display local .avif image.
  • url works: https://aomedia.org/assets/images/blog/parrot-avif.avif or any other url
  • local paths don't work: @assets/shared/images/profile.avif or ./profile.avif

I'm pretty sure path file is correct and it exists.

Screenshots

Alt Text Image

Dependency versions

  • React Native version: 0.78.0
  • React version: 19.0.0
  • React Native Fast Image version: 8.9.2
  • Hermes and New arch enabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions