Comments (4)
Thanks @pokusew , the examples run without errors.
from nfc-pcsc.
Hi @Kazturin,
Thank you for posting your issue here. 👍
It looks like a problem with your setup. Where are you trying to run nfc-pcsc? What build tools / bundlers are you using?
First, please note that nfc-pcsc can be used only in Node.js (either Node.js directly or in Electron.js).
nfc-pcsc cannot be used directly in browsers.
Second, make sure you correctly set up any build tools or bundlers (webpack, Rollup, Vite, etc.) you use to target Node.js and not to attempt to make it browser-compatible.
Hope it helps. Let me know. 🙂
from nfc-pcsc.
Hi @Kazturin,
Thank you for posting your issue here. 👍
It looks like a problem with your setup. Where are you trying to run nfc-pcsc? What build tools / bundlers are you using?
First, please note that nfc-pcsc can be used only in Node.js (either Node.js directly or in Electron.js). nfc-pcsc cannot be used directly in browsers.
Second, make sure you correctly set up any build tools or bundlers (webpack, Rollup, Vite, etc.) you use to target Node.js and not to attempt to make it browser-compatible.
Hope it helps. Let me know. 🙂
Hi pokusew.
Thanks a lot. I didn't expect such a quick response :)
Windows 10 OS, using vite builder, node v18.18
If I clone the project https://github.com/pokusew/nfc-pcsc.git and run it, then this error occurs:
from nfc-pcsc.
Hi @Kazturin,
Thank you for the details you provided.
First, I've just fixed the error you encountered while cloning and running the example (npm run example
). Thank you for posting the screenshot here. 👍 The error was affecting only some of the examples (so, for example, npm run example-uid-logger
worked). Nevertheless, everything should work now after the fix.
Can you please try again and let me know if it works for you now? Just to be sure, please delete the directory with the cloned repo, clone it again, run npm install
, and finally try npm run example
.
Second, you mentioned you use Vite in your project.
Note that nfc-pcsc can be used only in Node.js (either Node.js directly or in Electron.js).
Your Vite setup is probably the reason you see the error: Module "events" has been externalized for browser compatibility. Cannot access "events.EventEmitter" in client code.
I think that you need to appropriately set the build.target
in Vite's build options. Probably to something like node18
.
Hope it helps. Let me know. 🙂
from nfc-pcsc.
Related Issues (20)
- Mifare DESfire EV2 2k - error in step 2 - authenticate HOT 1
- Constructing APDU command on NTAG21x
- Error when writing data. Receives an Invalid data length error. HOT 3
- Authentication failed for same blocks BUT is Working in others HOT 1
- P2P Feature
- Empty Data
- Multi RFID Reader
- was compiled against a different Node.js version using NODE_MODULE_VERSION 111. This version of Node.js requires NODE_MODULE_VERSION 110. HOT 3
- UnhandledPromiseRejectionWarning: WriteError: Write operation failed: Status code: 0x6300 HOT 3
- I don't understand that code HOT 1
- Module not found: Error: Can't resolve 'fs' HOT 2
- Unable to run the basic example HOT 2
- Add disposition parameter in disconnect method
- MacOS installation issue using npm HOT 2
- Context Aware Native Module, Electron Context Isolation and Node Integration Support
- Unsupported engine Please Help
- Emulate Tag NFC?
- Sveltekit build fails when running 'npm run build' but works on 'npm run dev' HOT 1
- It turned out to connect the library in CRA(React)? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nfc-pcsc.