[tfjs-react-native] and managed Expo workflows
See original GitHub issueWith, @tensorflow/tfjs-react-native@0.2.1
, tfjs-react-native
is using react-native-fs
for the bundleResourceIO function. To the best of my knowledge, managed Expo
workflows do not work with react-native-fs
, instead, the recommended path is to use expo-file-system. Attempting to run a managed Expo app results in this error at runtime: TypeError: null is not an object (evaluating 'RNFSManager.RNFSFileTypeRegular')
.
To work around this, I forked the repo, and changed the bundle loading code into a stub. I published this code to NPM, installed it and ran it successfully in the context of a managed Expo workflow. I managed to get the example realtime demo working.
Based on the README, it appears that managed Expo workflows are within the set of project types supported by tfjs-react-native
, hence this issue.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:8 (5 by maintainers)
Top GitHub Comments
0.2.2 is out on NPM https://www.npmjs.com/package/@tensorflow/tfjs-react-native @robsco-git @jgough99 @MichaelMcNeil, give it a whirl and let me know if it doesn’t solve the issue.
Yes, once the component is unmounted the generator will be exhausted and this is expected behaviour. Another way to not have the null check is to cancel the requestAnimationFrame of this parent component. This is how i handled it in the updated demo https://github.com/tensorflow/tfjs/blob/master/tfjs-react-native/integration_rn59/components/webcam/realtime_demo.tsx#L126