Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when resolveAsync from remote url #18

Open
Richtervn opened this issue Sep 19, 2019 · 4 comments
Open

Error when resolveAsync from remote url #18

Richtervn opened this issue Sep 19, 2019 · 4 comments

Comments

@Richtervn
Copy link

I'm trying to resolve an image from url.

I called AssetUtils.resolveAsync('https://upload.wikimedia.org/wikipedia/en/1/17/Batman-BenAffleck.jpg') and this error throw:

[Unhandled promise rejection: Error: Expected URL scheme 'http' or 'https' but was 'file']

@linus
Copy link

linus commented Oct 14, 2019

I was bitten by this in expo-pixi, see bug report above. Also seems to be the same bug as #10, but maybe that one is more complicated. It seems to me as if expo-asset-utils fails to set localUri after downloading a remote resource (resolveAsync, if given a string, will use fromUriAsync to resolve an asset, then use resolveAsync again, at which point it will be an asset, which doesn't have localUri set, so it will try to download the asset, but at that point, uri is a file:// uri.

@obiwankenoobi
Copy link

@linus any success here? Thank you

@seand88
Copy link

seand88 commented Dec 1, 2020

any luck on this? i am seeing same issue.

@flyskywhy
Copy link

console.warn(await Asset.loadAsync(require('some.png')))

With [email protected] comes from [email protected]
I get the wrong [undefined]

With [email protected] comes from [email protected]
I get the right [{localUri, ...}]

So maybe you should upgrade react-native-unimodules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants