react-use-face-detection icon indicating copy to clipboard operation
react-use-face-detection copied to clipboard

Error when trying to use the package with React + Vite

Open matheuscostadesign opened this issue 5 months ago • 0 comments

Hi everyone,

I'm getting the following error simply by importing the library into a project created with React + Vite:

[plugin:vite:import-analysis] Failed to resolve entry for package "react-use-face-detection". The package may have incorrect main/module/exports specified in its package.json.

Image

Could you please take a look and fix this?

Thanks in advance!

package.json

{
  "name": "face-detection",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "@mediapipe/camera_utils": "^0.3.1675466862",
    "@mediapipe/face_detection": "^0.4.1646425229",
    "react": "^19.1.0",
    "react-dom": "^19.1.0",
    "react-use-face-detection": "^1.0.2",
    "react-webcam": "^7.2.0"
  },
  "devDependencies": {
    "@eslint/js": "^9.29.0",
    "@types/react": "^19.1.8",
    "@types/react-dom": "^19.1.6",
    "@vitejs/plugin-react": "^4.5.2",
    "eslint": "^9.29.0",
    "eslint-plugin-react-hooks": "^5.2.0",
    "eslint-plugin-react-refresh": "^0.4.20",
    "globals": "^16.2.0",
    "vite": "^7.0.0"
  }
}

matheuscostadesign avatar Jul 03 '25 11:07 matheuscostadesign