Image.resolveAssetSource not supported on web.
See original GitHub issue🐛 Bug Report
Summary of Issue
When I run Image.resolveAssetSource
on Expo web I get an error that the function doesn’t exist.
Environment - output of expo diagnostics
& the platform(s) you’re targeting
Targeting Expo web, SDK 39.
Reproducible Demo
Copy in the following code
import { Image } from 'react-native'
Image.resolveAssetSource({uri: 'foobar'})
Steps to Reproduce
Run the above code.
Expected Behavior vs Actual Behavior
Expect the code to run. Instead I receive the following error.
Unhandled Rejection (TypeError): react_native_web_dist_exports_Image__WEBPACK_IMPORTED_MODULE_6__.default.resolveAssetSource is not a function
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why Image.resolveAssetSource() is not returning the height ...
When I use it for static images(require()) it works fine and return the height and width property along with other useful properties, but...
Read more >How to obtain a URI for an image asset in React Native (With ...
React Native's official Image Component provides us with a method called resolveAssetSource(). This method takes a “number” (related to what I've mentioned ...
Read more >Example of Image.resolveAssetSource() in React Native
Image.resolveAssetSource() function is used to get local resource assets image folder image width and height. It return us 4 type of values ...
Read more >Image - React Native
A React component for displaying different types of images, including network ... GIF and WebP are not supported by default on Android.
Read more >Image · React Native 中文
DOCTYPE html> <meta charset="utf-8"> <title>React Native Web ... When building your own native code, GIF and WebP are not supported by default on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If your asset source is a string file path then you can polyfill with
Thanks for the link, I ended up writing my own polyfill, but good to know cheers.