exadel-inc / compreface-javascript-sdk

JavaScript SDK for CompreFace - free and open-source face recognition system from Exadel
https://exadel.com/solutions/compreface/
Apache License 2.0
74 stars 35 forks source link

Cant resolve 'fs' #32

Open CROmartin opened 2 years ago

CROmartin commented 2 years ago

Describe the bug When I try importing CompreFace from "@exadel/compreface-js-sdk" it fails because fs can't be resolved in @exadel/compreface-js-sdk/endpoints To Reproduce My code is exactly same as in video down bellow, although I can't run it after importing CompreFace Code example.

Expected behavior Project running successfully without errors

Logs

Screenshot 2022-05-10 at 22 49 08

Additional context Everything should work as I have followed tutorial straight forward

smchedlidze826 commented 2 years ago

The issue is tied to the version of react-scripts you are using. v5 has an issue as it excludes support for some node features that were available in lower versions.

Your quick fix is to take react scripts down to v4 until a fix for v5

you can run this command

npm i react-scripts@4.0.3

canst commented 10 months ago

Describe the bug I have had the same issue with failed compile because of the 'fs'. it fails because fs can't be resolved in @exadel/compreface-js-sdk/endpoints Then I downgraded the react-scripts to the version you specified. But I received another error: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:68:19) at Object.createHash (node:crypto:138:10) at module.exports (myPath\compreface-javascript-sdk-main\webcam_demo\node_modules\webpack\lib\util\createHash.js:135:53)

For me I conclude the is was the node version that is the problem in this case. I then drowngraded my node version to v.14 and it compiled successfully. But now I only have this start video button see image bellow

Screenshot 2023-11-14 081948
gaamaaresosa commented 5 months ago

Today only I happen to test this SDK I couldn't run successfully on my system.

Windows 10 64bit Visual Studio Code latest Node js 20+

I keep on getting some or the other error already every one mentioned here. Mainly "can't resolve fs"

ERROR in ./node_modules/@exadel/compreface-js-sdk/endpoints/common_endpoints.js 17:0-20 Module not found: Error: Can't resolve 'fs' in 'C:\Users\BRAYSUNG\Desktop\face_founder\compreface-javascript-sdk-1.0.0\face_founder_demo\node_modules\@exadel\compreface-js-sdk\endpoints'

ERROR in ./node_modules/@exadel/compreface-js-sdk/endpoints/verification_endpoints.js 17:0-20 Module not found: Error: Can't resolve 'fs' in 'C:\Users\BRAYSUNG\Desktop\face_founder\compreface-javascript-sdk-1.0.0\face_founder_demo\node_modules\@exadel\compreface-js-sdk\endpoints'

Downgrading Node or react-scripts is not good as the world moves faster ahead.

Can some help me running this SDK on latest Node, react-scripts, React/Next js ?

Or can any one suggesst other solutions, especially I am intersted on "face_founder_demo" Picking similar photos from a single photo given.