Skip to content

🐛 Requiring unknown module "2850". If you are sure the module exists, try restarting Metro. You may also want to run yarn or npm install., js engine: hermes #3657

@bbhxwl

Description

@bbhxwl

What's happening?

Image

Reproduceable Code

import {Camera, useCameraDevice, useCameraPermission, useSkiaFrameProcessor} from 'react-native-vision-camera';
import { Skia } from '@shopify/react-native-skia';
import {View} from "react-native";

export default function Test(){
    const device = useCameraDevice('front')
    const { hasPermission, requestPermission } = useCameraPermission()
    requestPermission()
    const frameProcessor = useSkiaFrameProcessor((frame) => {
        "worklet"
        frame.render()

        // 你也可以在其上继续绘制
        const paint = Skia.Paint()
        paint.setColor(Skia.Color('#ff0000'))
        const rect = Skia.XYWHRect(frame.width * 0.25, frame.height * 0.25, 120, 80)
        frame.drawRect(rect, paint)
    }, [])
    console.log("device",device)
    if (device == null) return (<View></View>)
    return (
        <Camera
            style={{width: "100%", height: "100%"}}
            device={device}
            isActive={true}
            frameProcessor={frameProcessor}
        />
    );
}

Relevant log output

ERROR  Error: Requiring unknown module "2850". If you are sure the module exists, try restarting Metro. You may also want to run `yarn` or `npm install`., js engine: hermes
 ERROR  Error: Requiring unknown module "2850". If you are sure the module exists, try restarting Metro. You may also want to run `yarn` or `npm install`., js engine: hermes
 ERROR  Warning: TypeError: Cannot convert undefined value to object

This error is located at:

Call Stack
  ScreenContentWrapper (<anonymous>)
  RNSScreenStack (<anonymous>)
  RNCSafeAreaProvider (<anonymous>)
  App (<anonymous>)
  ErrorOverlay (<anonymous>)

Camera Device

{"formats": [{"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1944, "photoWidth": 2592, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1080, "photoWidth": 1920, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1200, "photoWidth": 1600, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 720, "photoWidth": 1280, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 640, "photoWidth": 640, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 480, "photoWidth": 640, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 288, "photoWidth": 352, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 240, "photoWidth": 320, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 720, "videoStabilizationModes": [Array], "videoWidth": 1280}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1944, "photoWidth": 2592, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1080, "photoWidth": 1920, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1200, "photoWidth": 1600, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 720, "photoWidth": 1280, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 640, "photoWidth": 640, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 480, "photoWidth": 640, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 288, "photoWidth": 352, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 240, "photoWidth": 320, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 720}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1944, "photoWidth": 2592, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1080, "photoWidth": 1920, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 1200, "photoWidth": 1600, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 720, "photoWidth": 1280, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 640, "photoWidth": 640, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 480, "photoWidth": 640, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 288, "photoWidth": 352, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}, {"autoFocusSystem": "contrast-detection", "fieldOfView": 74.16322521852192, "maxFps": 30, "maxISO": 3200, "minFps": 6, "minISO": 0, "photoHeight": 240, "photoWidth": 320, "supportsDepthCapture": false, "supportsPhotoHdr": false, "supportsVideoHdr": false, "videoHeight": 480, "videoStabilizationModes": [Array], "videoWidth": 640}], "hardwareLevel": "limited", "hasFlash": false, "hasTorch": false, "id": "1", "isMultiCam": false, "maxExposure": 32, "maxZoom": 1, "minExposure": -32, "minFocusDistance": 100, "minZoom": 1, "name": "1 (FRONT) androidx.camera.camera2", "neutralZoom": 1, "physicalDevices": ["wide-angle-camera"], "position": "front", "sensorOrientation": "portrait", "supportsFocus": true, "supportsLowLightBoost": false, "supportsRawCapture": false}

Device

Android13

VisionCamera Version

4.7.2

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions