iOS - worklet error , Android - undefined error
See original GitHub issueHi guys i was heading some issue with iOS and Android both.
Android:
Frame Processor threw an error: undefined is not a function
iOS:
Error: Javascript worklet error
at _f (native)
Error: Exception in HostFunction: Javascript worklet error
...
i fixed it by directly using __scanCodes
here is example code that fully works for me
Solution
export const Scanner: React.FC = () => {
const devices = useCameraDevices();
const device = devices.back;
const frameProcessor = useFrameProcessor(frame => {
'worklet';
const barcodes = __scanCodes(frame, [BarcodeFormat.ALL_FORMATS]);
}, []);
if (device == null) return <></>;
return (
<Camera
style={{flex: 1}}
device={device}
isActive={true}
frameProcessor={frameProcessor}
frameProcessorFps={5}
/>
);
};
i’m not sure that exactly why this works. But i will work around when i have some time
Issue Analytics
- State:
- Created 2 years ago
- Reactions:12
- Comments:14
Top Results From Across the Web
Cannot read property 'installCoreFunctions' of undefined
I am trying to integrate Reanimated 2.0 in iOS React Native swift project and getting the below error. Android App is working fine...
Read more >Installation | React Native Reanimated - Software Mansion
After adding the react-native-reanimated/plugin to your project you may encounter a false-positive "Reanimated 2 failed to create a worklet" error.
Read more >a module failed to load due to an error and appregistry ...
I have android and ios app in react native which both uses webview to show ... ERROR TypeError: undefined is not an object...
Read more >GLView - Expo Documentation
Android Device, Android Emulator, iOS Device, iOS Simulator, Web ... To use this API inside Reanimated worklet, you need to pass the GL...
Read more >Troubleshooting | Stream Chat - React Native SDK Docs
Stream Chat for React Native relies heavily on context, in instances where the Render Error undefined is not a function occurs it is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey all, react-native-reanimated maintainer here.
Exception in HostFunction: Javascript worklet error
is a generic error message that shows up when some worklet throws an error (likeundefined is not a function
here). Reanimated catches all errors from worklets and passes them to the console or LogBox.While the error is caused by other third-party library, we are currently improving the developer experience by presenting the full error message instead of only “Javascript worklet error”. See the PR: https://github.com/software-mansion/react-native-reanimated/pull/3558
As per this issue for now you can do a patch so that you can build in Xcode 14