-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: hands.Hands is not a constructor #3796
Comments
Hi @mwbouwkamp-mendix, |
Hi, @kuaashish! I am trying to use the mediapipe library in a Mendix widget. For this, I did the following:
My useEffect function:
When using this widget in a Mendix app, I get the constructor error. |
Hi @mwbouwkamp-mendix
and create the hands object like
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
Unfortunately, this is not solving my issue. I still get the same error as before that it is not a constructor. Appology for the late resonse... |
Okay. Would it be possible to provide the minimal example code to reproduce the issue at our end, may be create a temporary GitHub repo to clone and test the error? |
To reproduce
Here is the repo https://github.com/mwbouwkamp-mendix/handTrackingWidget |
I also face this issue but only in production build, it happens with Camera in camera_utils too. For now i get Camera and Hands from cdn link instead of npm package and it work, the versions are same but npm package doesnt work in build |
i confirm have the same problem in production environnement only |
I'm facing the same error on production with a Vite Nuxt project ,i will try to reproduce with a CodePen |
Closing as stale. Please reopen if you'd like to work on this further. |
Hello @taha-azzabi @nohr This seems to be happening due to the Rollup CommonJS plugin, since this plugin can't work with obfuscated packages and the JS source code for MediaPipe is not public. Rollup uses static analysis to determine its exports. We are working on a solution to unveal the JS code so that this issue does not arise. Meanwhile, can you refer to #2883 (comment) and let us know if this works for you? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
The workaround is not working for me. Could you please provide me with an indication when this may be fixed?
|
@mwbouwkamp-mendix Thanks for letting us know the workaround no longer works. On the fix, we don't have any timeline yet, but I would suggest to expect a wait of around a month. |
We are in the process of creating new JS libraries that should not have this issue, as they are built using ESM. While they have not yet reached feature parity, you can find them here: https://www.npmjs.com/package/@mediapipe/tasks-vision, https://www.npmjs.com/package/@mediapipe/tasks-text, https://www.npmjs.com/package/@mediapipe/tasks-audio. The libraries are also open sourced in this repo: https://github.com/google/mediapipe/tree/master/mediapipe/tasks/web Due to our existing infrastructure, it is difficult for us to release the existing libraries using ESM. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
Maybe you can use vite-plugin-mediapipe:https://github.com/Spencer17x/arca/tree/main/packages/vite-plugin/vite-plugin-mediapipe |
per @schmidt-sebastian we used the new apis, @mediapipe/tasks-vision, which works properly in vite locally and in production. Over at Kinetix ML we have it working locally with vite and in production with vercel deploy after facing similar issues with the face landmarks api. You can checkout our implementation here https://github.com/Kinetix-ML/kml-pipe-ts/blob/main/src/operations/faceMeshDetect.ts |
System information (Please provide as much relevant information as possible)
Describe the current behavior:
When using the default code example, I get the error
TypeError: hands.Hands is not a constructor
code:
The text was updated successfully, but these errors were encountered: