spencer17x / arca

Inspired by Vite, a collection of CLI and libraries
MIT License
3 stars 1 forks source link

undefined is not a constructor #10

Open Timniel opened 11 months ago

Timniel commented 11 months ago

i get this error in production TypeError: undefined is not a constructor (evaluating 'new Gt.FaceMesh({locateFile:g=>https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh/${g}})')

then i decided to use this vite plugin but still same error.

`import { defineConfig } from "vite"; //import reactRefresh from "@vitejs/plugin-react-refresh"; import react from "@vitejs/plugin-react"; import path from "path"; import rollupReplace from "@rollup/plugin-replace"; import { mediapipe } from "vite-plugin-mediapipe"; // https://vitejs.dev/config/ export default defineConfig({ resolve: { alias: [ { // "@": path.resolve(dirname, "./src"), find: "@", replacement: path.resolve(dirname, "./src"), }, ], },

plugins: [ rollupReplace({ preventAssignment: true, values: { DEV: JSON.stringify(true), "process.env.NODE_ENV": JSON.stringify("development"), }, }), react(), mediapipe(), //reactRefresh(), ], });`

spencer17x commented 11 months ago

Could you please provide a minimum reproducible demo warehouse to facilitate my debugging and modification

Timniel commented 11 months ago

Running this https://github.com/Baizidmdashadzzaman/Faceshape-detection-using-MediaPipe-React-Js code on vite gives that error despite using your plugin, i guess probably because of the face_mesh. but when i used the plugin with face_detection it worked.

spencer17x commented 11 months ago

Because the plugin does not currently support face_mesh,You can check which ones are supported from here:https://github.com/spencer17x/arca/tree/main/packages/vite-plugin/vite-plugin-mediapipe

spencer17x commented 11 months ago

I run npm run dev can't start, it can be run with npm run start, you need to modify your README. Then you need to provide a complete and reproducible process. Tell me what the problem is now, what kind of results you expect, and provide screenshots and errors when appropriate.

Timniel commented 11 months ago

well that ain’t my code, just trying to point it to you that your plugin works for face detection and not face mesh on vite. i'll make the code tonight and share.