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

🐛 : ios Build error : The 'jsc/JSCRuntime.h' was not found #115

Open
2 of 4 tasks
mmlee0819 opened this issue Sep 12, 2023 · 11 comments
Open
2 of 4 tasks

🐛 : ios Build error : The 'jsc/JSCRuntime.h' was not found #115

mmlee0819 opened this issue Sep 12, 2023 · 11 comments

Comments

@mmlee0819
Copy link

mmlee0819 commented Sep 12, 2023

What's happening?

I'm trying to use the Frame Processors feature of react-native-vision-camera, so I installed react-native-worklets-core following the troubleshooting steps mentioned here.

Platform iOS in Podfile is 13.0 and Swift version is 5.2.

When I only had react-native-vision-camera installed, everything worked fine. However, after installing react-native-worklets-core, I encountered the following issue:

WKTJsRuntimeFactory.h:15:10 'jsc/JSCRuntime.h' file not found

image

babel.config.js

module.exports = api => {
  const babelEnv = api.env();

  const plugins = [
    [
      'babel-plugin-root-import',
      {
        rootPathSuffix: 'src',
        rootPathPrefix: '~',
      },
    ],
    ['module:react-native-dotenv'],
    ['react-native-worklets-core/plugin'],
  ];

  if (babelEnv !== 'development')
    plugins.push(['transform-remove-console', { exclude: ['error', 'warn'] }]);

  return {
    presets: ['module:metro-react-native-babel-preset'],
    plugins,
  };
};

I've reviewed the troubleshooting guide, but found none.
I would greatly appreciate any guidance or relevant resources to help me resolve this issue.

Reproduceable Code

No response

Relevant log output

ios:
/Users/xxxx/xxxxxxx/xxxxxxx/node_modules/react-native-worklets-core/cpp/WKTJsRuntimeFactory.h:15:10 'jsc/JSCRuntime.h' file not found

Camera Device

No response

Device

iOS 16.6.1
Xcode 14.3.1

VisionCamera Version

3.0.0

Package Versions

"react": "18.2.0"
"react-native": "0.71.6"
"react-native-reanimated": "2.17.0", unable to upgrade to 3.2.0 or higher for some reason.
"react-native-vision-camera": "^3.0.0" / "2.15.4" / "2.15.6" , tried 3 versions
"react-native-worklets-core": "^0.2.0"

Can you reproduce this issue in the VisionCamera Example app?

  • I can reproduce the issue in the VisionCamera Example app.

Additional information

If need any other information, please feel free to let me know.

@vadbertalan
Copy link

I encountered same issue. I found out that swapping the problematic row to #include <react-jsc/JSCRuntime.h> solves the problem and the app builds. Reference: mrousavy/react-native-vision-camera#1450 (comment)

		"react": "18.2.0",
		"react-native": "0.72.4",
		"react-native-vision-camera": "3.0.0",
		"react-native-worklets-core": "0.2.0",
		"react-native-reanimated": "3.3.0",

@vadbertalan
Copy link

Submitted PR (#118) with the possible fix.

@mmjc29
Copy link

mmjc29 commented Sep 28, 2023

Same problem

But I don't want to udpate the react-native 0.72.4

I am still on 0.70

Is it neccessary to update ?

@PauloGrachetelli
Copy link

Same problem

But I don't want to udpate the react-native 0.72.4

I am still on 0.70

Is it neccessary to update ?

if you want publish apps at android 33 API you must update RN version =(

@josh-thompson13
Copy link

Same problem guys.

I tried to "<react-jsc/JSCRuntime.h>" fix mentioned above and just got the same error.

Packages:
"react-native-vision-camera": "3.2.2",
"react-native-worklets-core": "0.2.2",

@PauloGrachetelli
Copy link

PauloGrachetelli commented Oct 25, 2023

if you need this package for qr scanner, just use latest version of vision camera
you dont need install other packages for qr scanner

@josh-thompson13
Copy link

josh-thompson13 commented Oct 25, 2023

@PauloGrachetelli So I removed worklets core and now I can build on IOS... but can no longer build on web. Getting the following error when building with metro:

error: Error: Unable to resolve module react-native-worklets-core from /Users/USER/WORK/PROJECT/node_modules/react-native-vision-camera/lib/commonjs/FrameProcessorPlugins.js: react-native-worklets-core could not be found within the project or in these directories:
  node_modules/react-native-vision-camera/node_modules
  node_modules
  15 | };
  16 | let runOnAsyncContext = (_frame, _func) => {
> 17 |   throw new _CameraError.CameraRuntimeError('system/frame-processors-unavailable', 'Frame Processors are not available, react-native-worklets-core is not installed!');
     |                                                                                                                         ^
  18 | };
  19 | try {
  20 |   (0, _JSIHelper.assertJSIAvailable)();
    at ModuleResolver.resolveDependency (/Users/USER/WORK/PROJECT/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:15)
    at DependencyGraph.resolveDependency (/Users/USER/WORK/PROJECT/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
    at Object.resolve (/Users/USER/WORK/PROJECT/node_modules/metro/src/lib/transformHelpers.js:129:24)
    at resolve (/Users/USER/WORK/PROJECT/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
    at /Users/USER/WORK/PROJECT/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (/Users/USER/WORK/PROJECT/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
    at processModule (/Users/USER/WORK/PROJECT/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
    at async addDependency (/Users/USER/WORK/PROJECT/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)
    at async Promise.all (index 5)
 MAP  ./index.js 

@PauloGrachetelli
Copy link

"react-native-worklets-core": "^0.2.0",
"react-native-vision-camera": "3.3.1",
https://www.react-native-vision-camera.com/docs/guides/code-scanning

Try this, a month ago everyone had a similar error, it was fixed in this version

@francesco-clementi-92
Copy link

I have also the same problem with the following packages:

"react-native": "0.71.14",
"react-native-vision-camera": "^3.6.4",
"react-native-worklets-core": "^0.2.4",

switching to #include <react-jsc/JSCRuntime.h> doesn't fix the problem

@rafaelmotta
Copy link

same here. From my understanding, this is because Hermes is required. would be great if we could use JSC too

@LongNguyen2312
Copy link

Is there a solution for this problem yet?

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

8 participants