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

It turned out to connect the library in CRA(React)? #152

Open
GABuryan opened this issue Feb 1, 2024 · 1 comment
Open

It turned out to connect the library in CRA(React)? #152

GABuryan opened this issue Feb 1, 2024 · 1 comment

Comments

@GABuryan
Copy link

GABuryan commented Feb 1, 2024

I used create-react-app (webpack 5). Errors on compilation.

If const {NFC} = require('nfc-pcsc') , then error : Uncaught TypeError: Cannot read properties of undefined (reading 'default')
at Object.get [as NFC]

if

const NFC = require('nfc-pcsc')
  const nfc = new NFC()

then error : Uncaught TypeError: NFC is not a constructor

How to solve the problem?

@alexgoto
Copy link

alexgoto commented Feb 7, 2024

@GABuryan

This module provides access to Smart Cards only from Node.js context. React is context of web browser.

You can not interact with OS Smart Card API directly on machine which uploads your JavaScript in self browser.

User browser need to install some sort of additional 'interface' for this. For example an extension.

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

2 participants