I am creating a React JS-based front end that employs the Tensorflow JS Simple Face Detection model. The application runs fine when being run on the dev environment using npm run dev. However when I run npm run build and npm run preview the model throws the following error:
index-BEYgabte.js:15635 Uncaught (in promise) TypeError: Zse.FaceDetection is not a constructor at new t (index-BEYgabte.js:15635:1827) at index-BEYgabte.js:15635:3968 at index-BEYgabte.js:15635:1457 at Object.next (index-BEYgabte.js:15635:1562) at index-BEYgabte.js:15635:499 at new Promise (<anonymous>) at l0 (index-BEYgabte.js:15635:250) at SEe (index-BEYgabte.js:15635:3683) at index-BEYgabte.js:15635:15604 at index-BEYgabte.js:15635:1457
This is the picture of the preview

This is the picture of the dev

I am creating a React JS-based front end that employs the Tensorflow JS Simple Face Detection model. The application runs fine when being run on the dev environment using
npm run dev. However when I runnpm run buildandnpm run previewthe model throws the following error:index-BEYgabte.js:15635 Uncaught (in promise) TypeError: Zse.FaceDetection is not a constructor at new t (index-BEYgabte.js:15635:1827) at index-BEYgabte.js:15635:3968 at index-BEYgabte.js:15635:1457 at Object.next (index-BEYgabte.js:15635:1562) at index-BEYgabte.js:15635:499 at new Promise (<anonymous>) at l0 (index-BEYgabte.js:15635:250) at SEe (index-BEYgabte.js:15635:3683) at index-BEYgabte.js:15635:15604 at index-BEYgabte.js:15635:1457This is the picture of the preview

This is the picture of the dev
