question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import tfjs-react-native not working on EXPO CLI Project

See original GitHub issue

Describe the problem or feature request

Screen Shot 2020-02-23 at 12 04 47 AM

I’m getting this error when I try to run my React-Native program on the web or android. I followed the steps on the tfjs-react-native documentation but I’m still having issues with my program.

TensorFlow.js version

tfjs-react-native

Browser version

package.json Screen Shot 2020-02-23 at 12 15 50 AM

Code to reproduce the bug / link to feature request

This is the code causing the error Screen Shot 2020-02-23 at 12 17 50 AM

I even removed the tfjs-react native import and it compiles so I don’t know what to do

If you would like to get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

GitHub issues for this repository are tracked in the tfjs union repository.

Please file your issue there, following the guidance in that issue template.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
pvaneckcommented, Feb 28, 2020

That compiled_api.ts file will be removed from the dist directory in the next tfjs release (with https://github.com/tensorflow/tfjs/commit/fb163f7f1f8cbb953a856f1621d8b1bad44afd04) as it shouldn’t even be there. For a quick fix, just delete that typescript file:

rm -f node_modules/@tensorflow/tfjs-converter/dist/src/data/compiled_api.ts

Then metro should stop complaining.

1reaction
pvaneckcommented, Mar 13, 2020

Doesn’t seem like fetch supports local afaik. Might have to use expo-file-system to load local images for now.

@motya770 Which error are you getting? I have a barebones TF.js typescript expo managed project that can load fine for me (https://github.com/pvaneck/tfjs-react-native-app) if you want to check that out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tfjs-react-native-expo-fix - npm
Step 1. Create your react native app. ... You can use the React Native CLI or Expo. This library relies on a couple...
Read more >
REACT NATIVE - Can't install Realm Sync - Expo version 44
Problem : We have installed Expo version 44 (because a later or earlier version of Expo does not match with realm), but can...
Read more >
Setup Tensorflow.js to React Native Expo project
import React from 'react' import { Text, View } from 'react-native' import * as tf from '@tensorflow/tfjs' class App extends React.
Read more >
null is not an object (evaluating 'rnfsmanager.rnfsfiletyperegular')
Solution for android is react-native link react-native-fs then react-native run-android to re-run the app. Open side panel.
Read more >
Experimenting with TensorFlow.js - Tao
yarn add global expo-cli # Creates a bare bones React Native ... as tf from "@tensorflow/tfjs"; import "@tensorflow/tfjs-react-native"; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found