pokusew / nfc-pcsc

Easy reading and writing NFC tags and cards in Node.js
MIT License
533 stars 132 forks source link

Uncaught TypeError: Cannot read property 'modules' of undefined #113

Closed mastudillot closed 2 years ago

mastudillot commented 3 years ago

I have an error importing the library, I have no idea the reason for the error. can help me?

node version: v14.16.0 Electron: v11 Vue: v3

The error:

Uncaught TypeError: Cannot read property 'modules' of undefined
    at Object.eval (bindings.js?dfc1:29)
    at eval (bindings.js:223)
    at Object../node_modules/bindings/bindings.js (chunk-vendors.js:106)
    at __webpack_require__ (app.js:849)
    at fn (app.js:151)
    at Object.eval (pcsclite.js:formatted:6)
    at eval (pcsclite.js:formatted:211)
    at Object../node_modules/@pokusew/pcsclite/lib/pcsclite.js (chunk-vendors.js:11)
    at __webpack_require__ (app.js:849)
    at fn (app.js:151)

My code in App.vue

<script>
import { NFC } from 'nfc-pcsc';

export default {
  name: 'App',
  components: {
  },
  beforeCreate() {
  },
}
</script>

package.json:

{
  "name": "vue-electron-nfc-test",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "electron:build": "vue-cli-service electron:build",
    "electron:serve": "vue-cli-service electron:serve",
    "postinstall": "electron-builder install-app-deps",
    "postuninstall": "electron-builder install-app-deps"
  },
  "main": "background.js",
  "dependencies": {
    "@tailwindcss/postcss7-compat": "^2.0.2",
    "autoprefixer": "^9",
    "axios": "^0.21.1",
    "core-js": "^3.6.5",
    "electron-rebuild": "^2.3.5",
    "nfc-pcsc": "^0.8.1",
    "pcsclite": "^1.0.0",
    "postcss": "^7",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
    "vue": "^3.0.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "babel-eslint": "^10.1.0",
    "electron": "^11.0.0",
    "electron-devtools-installer": "^3.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^7.0.0",
    "vue-cli-plugin-electron-builder": "~2.1.1",
    "vue-cli-plugin-tailwind": "~2.0.6"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/vue3-essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}