electron: [Bug]: WebSerial - SerialPort doesn't open in Electron 20

Preflight Checklist

Electron Version

20.0.1

What operating system are you using?

Windows

Operating System Version

Win 10 Pro 19043

What arch are you using?

x64

Last Known Working Electron version

19.0.11

Expected Behavior

WebSerial API should open a serial port.

Actual Behavior

The getInfo method works fine, but open fails to open the port.

Testcase Gist URL

https://gist.github.com/17afc65be515f3a1aec6256cb69f069d https://github.com/rafaelpimpa/electron-webserial-bug-repro

Additional Information

Error thrown is NetworkError: Failed to open serial port. I didn’t use an Arduino to test, but it should work the same, since it works in v19. Reproduction has the same code from the docs.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@codebytere I don’t think this has been fixed correctly (or if it has then it seems to have regressed). This is still an issue in Electron 23.1.0. I tested it on Electron 19.1.8 and it is working perfectly but fails on Electron 23.1.0. Let me know if you’d like me to put together a gist?

hey - yeah, i need to manually open a backport to 20. I can try to do it tomorrow 😃

@rafaelpimpa sweet - so here: https://github.com/electron/electron/compare/v20.0.0-nightly.20220517...v20.0.0-nightly.20220518

i’d guess the Chromium roll - we’ll keep looking from here, thank you 🙇🏻‍♀️

In the end, I managed to get it working using Electron version 23.2.1 on my Mac running 13.3.1 using this gist: https://gist.github.com/rafaelpimpa/17afc65be515f3a1aec6256cb69f069d

@rafaelpimpa got a fix up!