Closed Sachin1116 closed 6 months ago
I am getting this error also
its working I change in babel
module.exports = { presets: ["module:@react-native/babel-preset"], plugins: [ ['react-native-reanimated/plugin', { processNestedWorklets: true }], ["react-native-worklets-core/plugin"] ] };
My babel config is also same module.exports = { presets: ['module:@react-native/babel-preset'], plugins: [ ['react-native-worklets-core/plugin'], [ 'react-native-reanimated/plugin', { processNestedWorklets: true, }, ], ], }; can u share please your Camera component?
<Camera ref={camera} style={StyleSheet.absoluteFill} isActive={isCameraActive} device={cameraDevice} photo={true} // format={cameraFormat} onError={handleCameraMountError} faceDetectionCallback={handleFacesDetected} faceDetectionOptions={faceDetectionOptions} />
how did you write handleFacesDetected component?
i wrote it like const handleFacesDetectionn = Worklets.createRunOnJS( (faces: Face[], frame: Frame) => {
i wrote same as @nonam4 example but it throw same error still :( Frame Processor Error: Regular javascript function '' cannot be shared. Try decorating the function with the 'worklet' keyword to allow the javascript function to be used as a worklet., js engine: VisionCamera
i am using bare workflow
Getting error with Frame Processor Error: runOnJs(faces,frame).finally is not a function (it is undefined), js engine: VisionCamera
But when do changes in node modules react-native-vision-camera-face-detector camera.tsx its working fine.
const cameraFrameProcessor = useFrameProcessor( ( frame ) => { 'worklet' runAsync( frame, async () => { 'worklet' const internal = frame as FrameInternal const faces = detectFaces( frame )
// increment frame count so we can use frame on
// js side without frame processor getting stuck
internal.incrementRefCount()
await runOnJs(
faces,
frame
)
// .finally( () => {
// // finally decrement frame count so it can be dropped
internal.decrementRefCount()
// } )
} )
}, [ runOnJs ] )
@Sachin1116 thank you so much you saved me from getting fired))
I can't reproduce this issue. Everything is working fine for me in both example app and on my final project.
There is some parameter that prevents this error for you. Maybe you have dedecting delay or something else? But This error happened for me 100% and fixed after apply @Sachin1116 last change
@Nurmehemmed Did you tested using example app?
No i only test on my app but there is not something weird in my app. All dependencies versions are same with your example app. I tested on Samsung device when problem appear
Can you please check if f555c39 fix the issue?
I can confirm that original problem was solved on 1.6.1 version as it's working on builded (also store published) apps.
Frame Processor Error: Regular javascript function '' cannot be shared. Try decorating the function with the 'worklet' keyword to allow the javascript function to be used as a worklet., js engine: VisionCamera