react-native-worklets-core icon indicating copy to clipboard operation
react-native-worklets-core copied to clipboard

๐Ÿ› : ios Build error : The 'jsc/JSCRuntime.h' was not found

Open mmlee0819 opened this issue 1 year ago โ€ข 11 comments

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.

mmlee0819 avatar Sep 12 '23 07:09 mmlee0819

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: https://github.com/mrousavy/react-native-vision-camera/issues/1450#issuecomment-1418959307

		"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 avatar Sep 14 '23 15:09 vadbertalan

Submitted PR (https://github.com/margelo/react-native-worklets-core/pull/118) with the possible fix.

vadbertalan avatar Sep 14 '23 16:09 vadbertalan

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 ?

mmjc29 avatar Sep 28 '23 10:09 mmjc29

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 =(

PauloGrachetelli avatar Sep 28 '23 20:09 PauloGrachetelli

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",

josh-thompson13 avatar Oct 24 '23 23:10 josh-thompson13

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

PauloGrachetelli avatar Oct 25 '23 21:10 PauloGrachetelli

@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 

josh-thompson13 avatar Oct 25 '23 23:10 josh-thompson13

"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

PauloGrachetelli avatar Oct 26 '23 00:10 PauloGrachetelli

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

francesco-clementi-92 avatar Nov 09 '23 16:11 francesco-clementi-92

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

rafaelmotta avatar Nov 09 '23 19:11 rafaelmotta

Is there a solution for this problem yet?

LongNguyen2312 avatar Feb 22 '24 10:02 LongNguyen2312