-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Node Serialport crashes #4622
Comments
+1 |
It crashes with SIGSEGV when doing something like this: import { SerialPort } from "serialport";
const sp = new SerialPort({
path: "/dev/ttyUSB0",
baudRate: 9600,
autoOpen: true,
}); output: EDIT: using serialport version 12.0.0 (works with node on version 20) |
* Fixes oven-sh#4622 * cleanup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This works for me in Bun
import { autoDetect } from "@serialport/bindings-cpp"
const Binding = autoDetect()
console.log(await Binding.list())
// see a list correctly But this doesn't (
import { SerialPort } from 'serialport'
const serial = new SerialPort({ path: '/dev/ttyACM0', baudRate: 115200, autoOpen: false })
serial.open((err) => console.log(err || 'success')) Error shows as follows:
Is this related to |
Interested in this |
I've tried this but it didn't work for me when running the script with @Jarred-Sumner in #5452 you mention "serialport no longer crashes" but it does, the same reproduction applies. It might be worth mentioning that I'm running this on modern MBPs, I haven't checked whether Linux / Windows would run. Thanks for looking into it so far! |
Got no luck too |
Bun is just quitting on me using the latest win 11 build. |
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983 (congrats btw!)
What platform is your computer?
Darwin 21.6.0 arm64 arm
What steps can reproduce the bug?
Reproduction here
bun install @serialport/bindings-cpp
This crashes with:
What is the expected behavior?
The Node Serialport packages work as expected, the list command lists available serial ports etc.
What do you see instead?
Crash:
Additional information
This package is the low-level interface for Node Serialport so I expect if this works the whole thing should. I suspect this issue has something to do with
napi
usage but I have 0 experience in this area.The text was updated successfully, but these errors were encountered: