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

Module not found: Error: Can't resolve 'fs' #143

Open
sunnyso246 opened this issue Jun 22, 2023 · 2 comments
Open

Module not found: Error: Can't resolve 'fs' #143

sunnyso246 opened this issue Jun 22, 2023 · 2 comments

Comments

@sunnyso246
Copy link

Hi,

I add the library in my react project and always get this error. Please advise how to solve it.

ERROR in ./node_modules/bindings/bindings.js and Module not found: Error: Can't resolve 'fs' in node-modules.

Use react script 5.0.1 and webpack 5.

Thanks
Sunny.

@alexgoto
Copy link

alexgoto commented Feb 7, 2024

Hi,

I add the library in my react project and always get this error. Please advise how to solve it.

ERROR in ./node_modules/bindings/bindings.js and Module not found: Error: Can't resolve 'fs' in node-modules.

Use react script 5.0.1 and webpack 5.

Thanks Sunny.

fs is is Node.js provided context. React works inside browser, where Node.js context is unavailable.

This module works only in Node.js.

If we talk about the whole task - browser can not provide access to Smart Cards from JavaScript (React in your situation) directly. Is is possible only if host machine of user of your JavaScript provide some of interface for this. For example this interface is browser extension

@danielduan
Copy link

For anyone trying to run this in Electron, the nodeIntegration flag needs to be switched on to get access to fs

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

3 participants