node-serialport
node-serialport copied to clipboard
SerialPort.list is not a function
SerialPort Version
10.5.0
Node Version
14.16
Electron Version
12.0.4
Platform
Microsoft Windows NT 10.0.22621.0 x64
Architecture
x64
Hardware or chipset of serialport
No response
What steps will reproduce the bug?
Just run the specified node version and you will get the issue (i guess)
What happens?
When running the code const board = new Board(); I get an error.
The error is the following (HardwareDevicesService.ts is my file):
board.js:42 Uncaught TypeError: serialport.list is not a function
at Board.detect (board.js:42)
at new Board (board.js:291)
at addBoard (HardwareDevicesService.ts:24)
What should have happened?
run without errors
Additional information
I'm using electron-forge but I dont think that matters.
Hi, not sure if this help but maybe you are importing SerialPort incorrectly (mind curly bracers :) ). Have a look at this example https://github.com/serialport/electron-serialport/blob/6cf4e28ec9df4d45e73d2ceca1e6e131af588956/renderer.js
Edited: @iamisti or check this thread: https://stackoverflow.com/a/63370876/2893810 It looks like it (list) has been moved
Hi @iamisti are you still experiencing this issue?
@iamisti Are you sure you are calling .list() on a class itself not on an instance of a class?