react-native-worklets-core
react-native-worklets-core copied to clipboard
๐ : ios Build error : The 'jsc/JSCRuntime.h' was not found
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
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
- [ ] I am using Expo
- [x] I have read the Troubleshooting Guide
- [x] I searched for similar issues in repository react-native-vision-camera and react-native-worklets-core and found none.
If need any other information, please feel free to let me know.
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",
Submitted PR (https://github.com/margelo/react-native-worklets-core/pull/118) with the possible fix.
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 ?
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 =(
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",
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 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
"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
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
same here. From my understanding, this is because Hermes is required. would be great if we could use JSC too
Is there a solution for this problem yet?