Electron Build with Serialport (indexOf Error)



  • I’ve found many suggestions on how to fix the following error:

    TypeError: Cannot read property 'indexOf' of undefined
        at Function.getFileName (bindings.js?dfc1:178)
        at bindings (bindings.js?dfc1:82)
        at eval (win32.js?7cf7:1)
        at Object../node_modules/@serialport/bindings/lib/win32.js (vendor.js:340)
        at __webpack_require__ (app.js:854)
        at fn (app.js:151)
        at eval (index.js?c888:6)
        at Object../node_modules/@serialport/bindings/lib/index.js (vendor.js:252)
        at __webpack_require__ (app.js:854)
        at fn (app.js:151)
    abort @ vue-router.esm.js?8c4f:2128
    

    I’m using the Quasar Electron module. Without the serialport packages, no error occurs. And importing the package is enough to trigger the error.

    I tried npm rebuild, electron-rebuild, and suggestions like that. It seems like the serialport package isn’t rebuilding even if I got no error messages when I start the rebuild process.

    Do I have to configure Quasar in some way? I’m using the Quasar CLI. The demo project at https://github.com/serialport/electron-serialport works fine, and I can see the rebuild process for serialport. But I cannot see the difference (besides they are not using Quasar at all).

    I’m open to any suggestions.


Log in to reply