Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant resolve 'fs' #32

Open
CROmartin opened this issue May 10, 2022 · 3 comments
Open

Cant resolve 'fs' #32

CROmartin opened this issue May 10, 2022 · 3 comments

Comments

@CROmartin
Copy link

CROmartin commented May 10, 2022

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
Copy link
Collaborator

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
Copy link

canst commented Nov 14, 2023

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
Copy link

gaamaaresosa commented Mar 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants