mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
6.72k stars 1k forks source link

💭 Exclude react-native-vision-camera during the development web build #2789

Closed lv-saikrishna closed 1 month ago

lv-saikrishna commented 1 month ago

Question

I have a react native project and I test the application using expo development web build using web browser and after I installed "react-native-vision-camera" in my application, I am getting the below error and application is not loading in browser, but when I build the app in expo it works fine.

Is there any way to exclude this package from development web build?

"NativeCameraModule.ts:11 Uncaught system/camera-module-not-found: Failed to initialize VisionCamera: VisionCamera currently does not work on web."

What I tried

No response

VisionCamera Version

4.0.1

Additional information

mrousavy commented 1 month ago

Well then you have to set up your babel / metro resolver to exclude VisionCamera when building for web.