vladmandic / face-api

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS
https://vladmandic.github.io/face-api/demo/webcam.html
MIT License
824 stars 149 forks source link

Face-API: import this lib cause critical dependency warning #132

Closed ljnferreira closed 1 year ago

ljnferreira commented 1 year ago

Issue Description

import { detectSingleFace, fetchImage, nets, TinyFaceDetectorOptions } from '@vladmandic/face-api/' emits WARNING in ./node_modules/@vladmandic/face-api/dist/face-api.esm.js 8:47-54 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

The same happens with all alternative imports

Steps to Reproduce

Install and use lib in a CRA environment with react-scripts v 5.0.1 (webpack 5) returns error on console

Environment

Face-API library version? 1.7.6 Built-in demo or custom code? custom Type of module used (e.g. js, esm, esm-nobundle)? esm Browser or NodeJS and version (e.g. NodeJS 14.15 or Chrome 89)? Node 16.14 / Chrome 107 OS and Hardware platform (e.g. Windows 10, Ubuntu Linux on x64, Android 10)? Manjaro Framework (if any) (e.g. React, NextJS, etc.)? React

ljnferreira commented 1 year ago

image

vladmandic commented 1 year ago

I just wrote a post on that - see #134 for details.
I'm closing the issue as resolved, but feel free to post on this thread with any further questions.