Trying out the Face Filter sample in Unity 6000.0.33f1, Needle 4.1.0-alpha.12 and Samples package 0.20.0-exp. I get this error with the face filters demo, has a dependency broke or updated?
chunk-HEWO6OBK.js?v=3ad703c5:33214 Needle Engine dependencies failed to load SyntaxError: The requested module '/node_modules/.vite/deps/@mediapipe_tasks-vision.js?v=4c4bd98e' does not provide an export named 'DrawingUtils' (at FaceFilter.ts:58:5)
The error message indicates that there’s an issue with the export of DrawingUtils from @mediapipe_tasks-vision.js. This is likely due to a change or update in the mediapipe library that deprecated or removed the DrawingUtils export. Here’s how you can address this issue:
Verify the Version of Dependency: Check which version of @mediapipe you are using. It’s possible that an update to the library removed or renamed DrawingUtils.
Check for Updates or Breaking Changes: Visit the official mediapipe library documentation or their release notes for any breaking changes related to DrawingUtils. It’s possible they introduced an alternative or renamed the utility.
Update Imports in FaceFilter.ts: If DrawingUtils is no longer available in their API, you will need to find an alternative function or utility that serves the same purpose. Modify the import in FaceFilter.ts accordingly to accommodate the changes in the mediapipe library.
Check the Needle Engine Compatibility: Ensure that the version of Needle Engine you are using is compatible with this version of mediapipe. You might need to update your package or apply some patches if there are compatibility issues.
Here’s an example of how you might adapt your code if a replacement utility is available (pseudo-code):
// Before
import { DrawingUtils } from '@mediapipe_tasks-vision.js';
// After - use an alternative utility if available
import { NewDrawingUtils } from '@mediapipe_tasks-vision.js';
You can also reach out on forums or the Needle Engine community if detailed help is needed related to this specific integration. You might also find updated documentation or insights there related to common issues with the Face Filter sample and mediapipe (see faq).
24 replies left thread_Iz1UGBkPBmbSdj8KJX1CashI Reply to this message to continue the conversation
As a workaround you should be able to install a locked version in your main project that doesnt have this issue (see the linked github above, that means a version without any wilcards like the ^ which allows for patch version updates). The facefilter sample uses "@mediapipe/tasks-vision": "^0.10.14" which is why it installed the latest patch version that has the issue…
Ill make sure to lock the version in the next package update to avoid this in the future.
Thanks that is very useful! That helped work around the issue thanks for the fast help with this, very excited to play around with the blendshapes and mediapipe integration!