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

SerialPort.list is not a function #2567

Open
iamisti opened this issue Nov 27, 2022 · 3 comments
Open

SerialPort.list is not a function #2567

iamisti opened this issue Nov 27, 2022 · 3 comments

Comments

@iamisti
Copy link

iamisti commented Nov 27, 2022

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.

@serialport serialport deleted a comment from Ashkikhan Dec 19, 2022
@miroslawlis
Copy link

miroslawlis commented Feb 10, 2023

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

@GazHank
Copy link
Contributor

GazHank commented Jun 22, 2023

Hi @iamisti are you still experiencing this issue?

@yangit
Copy link

yangit commented Apr 19, 2024

@iamisti Are you sure you are calling .list() on a class itself not on an instance of a class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants