TypeError: Super constructor null of nJ is not a constructor (for ImageSegmenter initialization) #5638
Labels
platform:javascript
MediaPipe Javascript issues
task:image segmentation
Issues related to image segmentation: Locate objects and create image masks with labels
type:support
General questions
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
Web Browser (Chrome)
MediaPipe Tasks SDK version
@mediapipe/tasks-vision@0.10.2
Task name (e.g. Image classification, Gesture recognition etc.)
Image Segmenter
Programming Language and version (e.g. C++, Python, Java)
Javascript
Describe the actual behavior
Error initializing ImageSegmenter in production, although it works locally.
Describe the expected behaviour
Successful initialization of ImageSegmenter and ability to perform image segmentation on webcam feed
Standalone code/steps you may have used to try to get what you need
Also, since this is a nextjs project, I'm dynamically importing the component like so:
Other info / Complete Logs
The ImageSegmentationComponent component I created works perfectly in local environment, but breaks in production. Specifically is not able to initialize ImageSegmenter class.
Also, interestingly, when I swap out the model for the FaceLandmarker model and change the params accordingly, the component works perfectly. I am not sure why this would be the case.
Here is the full error trace I see in the console (it is not very informative):
TypeError: Super constructor null of nJ is not a constructor
at new nJ (211.25927c0cdec0fb60.js:1:49860)
at ie (211.25927c0cdec0fb60.js:1:17442)
at tX.Ie [as aa] (211.25927c0cdec0fb60.js:1:22081)
at tX.get (211.25927c0cdec0fb60.js:1:21885)
at 211.25927c0cdec0fb60.js:1:21489
at tX.forEach ()
at tX.forEach (211.25927c0cdec0fb60.js:1:21459)
at 211.25927c0cdec0fb60.js:1:135863
at rB.J (211.25927c0cdec0fb60.js:1:135904)
at 211.25927c0cdec0fb60.js:1:57803
console. @ watchConsoleLogs.8258a5d6.js:6
overrideMethod @ react_devtools_backend_compact.js:13851
(anonymous) @ 893.99515cd9419e7cfc.js:1
await in (anonymous)
(anonymous) @ 893.99515cd9419e7cfc.js:1
Rj @ framework-0c7baedefba6b077.js:9
Ik @ framework-0c7baedefba6b077.js:9
(anonymous) @ framework-0c7baedefba6b077.js:9
Qk @ framework-0c7baedefba6b077.js:9
Fk @ framework-0c7baedefba6b077.js:9
jg @ framework-0c7baedefba6b077.js:9
(anonymous) @ framework-0c7baedefba6b077.js:9
The text was updated successfully, but these errors were encountered: