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

TypeError: FileSystem.downloadAsync is not a function. #17

Open
Sanva opened this issue Jun 2, 2019 · 0 comments
Open

TypeError: FileSystem.downloadAsync is not a function. #17

Sanva opened this issue Jun 2, 2019 · 0 comments

Comments

@Sanva
Copy link

Sanva commented Jun 2, 2019

Hi!!

In a newly created expo app I'm trying to use expo-asset-utils, but it just wont work, and I simply don't understand why πŸ˜•

Steps to reproduce:

  1. expo init expo-test02 β€” Using blank template and npm.
  2. cd expo-test02
  3. npm install --save expo-asset-utils
  4. Edit App.js simply adding:
import AssetUtils from 'expo-asset-utils';

const remoteImage = 'https://upload.wikimedia.org/wikipedia/en/1/17/Batman-BenAffleck.jpg';
AssetUtils.resolveAsync(remoteImage).then(asset => console.log(asset));
  1. expo start and run the app.

Ignoring the fact that trying to log that object may have not sense at all, the problem I have is that AssetUtils.resolveAsync can't be called at all:

[Unhandled promise rejection: TypeError: FileSystem.downloadAsync is not a function. (In 'FileSystem.downloadAsync(url, localUri, {]
- node_modules/expo-asset-utils/src/fileInfoAsync.js:64:62 in <unknown>
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:271:30 in invoke
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:135:28 in invoke
- node_modules/regenerator-runtime/runtime.js:170:17 in <unknown>
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/regenerator-runtime/runtime.js:169:27 in callInvokeWithMethodAndArg
- node_modules/regenerator-runtime/runtime.js:192:38 in enqueue
- node_modules/regenerator-runtime/runtime.js:216:8 in async
* fileInfoAsync@http://192.168.0.135:19005/node_modules/expo/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false&assetPlugin=%2Fhome%2Fvalentin%2FEscritorio%2Fexpo-test%2Fnode_modules%2Fexpo%2Ftools%2FhashAssetFiles.js:150288:38 in <unknown>
- node_modules/expo-asset-utils/src/fromUriAsync.js:20:50 in fromUriAsync$
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:271:30 in invoke
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:135:28 in invoke
- node_modules/regenerator-runtime/runtime.js:170:17 in <unknown>
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/regenerator-runtime/runtime.js:169:27 in callInvokeWithMethodAndArg
- node_modules/regenerator-runtime/runtime.js:192:38 in enqueue
- node_modules/regenerator-runtime/runtime.js:216:8 in async
- node_modules/expo-asset-utils/src/fromUriAsync.js:19:0 in fromUriAsync
- node_modules/expo-asset-utils/src/resolveAsync.js:27:37 in resolveAsync$
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:271:30 in invoke
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:135:28 in invoke
- node_modules/regenerator-runtime/runtime.js:170:17 in <unknown>
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/regenerator-runtime/runtime.js:169:27 in callInvokeWithMethodAndArg
- node_modules/regenerator-runtime/runtime.js:192:38 in enqueue
- node_modules/regenerator-runtime/runtime.js:216:8 in async
- node_modules/expo-asset-utils/src/resolveAsync.js:18:21 in resolveAsync
* App.js:7:24 in <unknown>
- node_modules/metro/src/lib/polyfills/require.js:292:12 in loadModuleImplementation
- node_modules/expo/AppEntry.js:2:0 in <unknown>
- node_modules/metro/src/lib/polyfills/require.js:292:12 in loadModuleImplementation
- node_modules/metro/src/lib/polyfills/require.js:179:45 in guardedLoadModule
* null:null in global code

Looks that there is no FileSystem.downloadAsync, but I see it in https://docs.expo.io/versions/v32.0.0/sdk/filesystem/#filesystemdownloadresumabledownloadasync .

Do you know what could be missing in my system?

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

1 participant