EvanBacon / expo-chroma-key-camera

Live green-screen effect with Expo and THREE.js
32 stars 5 forks source link

undefined is not an object (evaluating '_expo.FileSystem.writeAsStringAsync') #1

Open wodin opened 5 years ago

wodin commented 5 years ago

I cloned the repository, ran yarn and then expo start. When I tried to load the app in the Expo client on my Samsung Galaxy S8 phone I got the following two errors:

undefined is not an object (evaluating '_expo.FileSystem.writeAsStringAsync')
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:168927:44
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:157376:61
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:157342:53
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:157337:14
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:157244:14
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:157162:54
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:156348:31
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
<unknown>
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:1385:48
loadModuleImplementation
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:276:14
guardedLoadModule
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:152:47
global code
    AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:233322:4
undefined is not an object (evaluating '_expo.FileSystem.writeAsStringAsync')
<unknown>
    HTMLImageElement.js:3:8
loadModuleImplementation
    require.js:331:6
<unknown>
    Document.js:3
loadModuleImplementation
    require.js:331:6
<unknown>
    module.js:1
loadModuleImplementation
    require.js:331:6
<unknown>
    index.js:1
loadModuleImplementation
    require.js:331:6
<unknown>
    ExpoTHREE.js:1
loadModuleImplementation
    require.js:331:6
<unknown>
    index.js:6
loadModuleImplementation
    require.js:331:6
<unknown>
    App.js:4
loadModuleImplementation
    require.js:331:6
<unknown>
    AppEntry.js:4
loadModuleImplementation
    require.js:331:6
guardedLoadModule
    require.js:197:45
global code
$ expo diagnostics

  Expo CLI 3.0.9 environment info:
    System:
      OS: Linux 4.4 Ubuntu 14.04.6 LTS, Trusty Tahr
      Shell: 4.3.11 - /bin/bash
    Binaries:
      Node: 12.6.0 - /usr/local/node/bin/node
      Yarn: 1.17.3 - /usr/bin/yarn
      npm: 6.10.2 - /usr/local/node/bin/npm
    npmPackages:
      expo: ^33.0.0 => 33.0.7 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8 
    npmGlobalPackages:
      expo-cli: 3.0.9

Expo client version: 2.12.0

rivvid commented 4 years ago

I have the 2nd error you posted as well - what's strange is that I had this running fine, was playing with it and broke it - so re-cloned the repo and suddenly it won't run. No idea what changed behind the scenes to cause this.

Also note this is iOS only, so it won't run on a Samsung/Android device.

rivvid commented 4 years ago

FYI, I fixed expo to 33.0.0 and bumped expo-three to 4.0.6 and that got me up and running.

wodin commented 4 years ago

Thanks, @rivvid. Surprisingly that got the app running for me too. However if I choose an image I now get the following two warnings:

[Unhandled promise rejection: Error: Expected URL scheme 'http' or 'https' but was 'file']
- node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:155:41 in createErrorFromErrorData
- node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:104:55 in <unknown>
- ... 5 more stack frames from framework internals

[Unhandled promise rejection: Error: Expected URL scheme 'http' or 'https' but was 'file']
- node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:155:41 in createErrorFromErrorData
- node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:104:55 in <unknown>
- ... 5 more stack frames from framework internals

Screenshot_20191030-090002_Expo

Maybe that has something to do with testing it on an Android phone, though :laughing:

wodin commented 4 years ago

After this, upgrading to expo 33.0.7 works as well.

rivvid commented 4 years ago

BTW thank you @EvanBacon for publishing this repo, helped me kickstart our Halloween haunt this year -- we used some pre-recorded and live greenscreen effects, and as a non-iOS developer this Expo app was my saving grace -- here's some videos of the end results:

https://www.instagram.com/p/B4VDuHup8p4/ https://www.instagram.com/p/B4VDeJBJoe5/ https://www.instagram.com/p/B4TqIfIA8Ix/