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.

camera_stream.js parse failed in tfjs-react-native:0.2.3

See original GitHub issue

To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

TensorFlow.js version

@tensorflow/tfjs-react-native": "^0.2.3"

Browser version

Chrome 83.0.4103.61

Describe the problem or feature request

Run with expo start --web and camera_stream.js module parse failed as below.

/node_modules/@tensorflow/tfjs-react-native/dist/camera/camera_stream.js 288:12
Module parse failed: Unexpected token (288:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|             const cameraComp = (
|             //@ts-ignore see https://github.com/microsoft/TypeScript/issues/30650
>             <CameraComponent key='camera-with-tensor-camera-view' {...(cameraProps)} ref={(ref) => (this.camera = ref)}/>);
|             // Create the glView if the camera has mounted.
|             let glViewComponent = null;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tafsiricommented, May 28, 2020

@daoshengmu we currently don’t have any plans to support expo-web with tfjs-react-native (android and ios support only). We recommend just using regular tfjs for web applications (i.e. do not import the tfjs-react-native package when targeting browsers).

0reactions
TomasGonzalezcommented, Nov 4, 2022

I know that this thread is closed, but I came here and by the conclusion I thought there was no way out of it. But I just kept reading the readme and was able to fix it by adding the appropriate loaders:

To the webpack config (This is in the step 4 of the readme)

const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function(env, argv) {
  const config = await createExpoWebpackConfigAsync(
      {
        ...env,
        babel: {
          dangerouslyAddModulePathsToTranspile: [
            // Ensure that all packages starting with @tensorflow are
            // transpiled.
            '@tensorflow',
          ],
        },
      },
      argv);
  return config;
};

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error of build because of the error Module parse failed
I have trouble related to Unexpected character of node module file. Here is my next.config.js ...
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