Web Serial API – Unhandled Rejection (TypeError): Failed to execute ‘open’ on ‘SerialPort’: required member baudRate is undefined

  chromium, javascript, serial-port

The code below used to work a few months ago. I cloned my repo and now it seems there’s a problem:
Unhandled Rejection (TypeError): Failed to execute 'open' on 'SerialPort': required member baudRate is undefined.

  async function getPortAndStartReading() {
    if (!portFound) {
      const port = await navigator.serial.requestPort()
    > await port.open({ baudrate: 9600 })
      reader = port.readable.getReader()
      outputStream = port.writable
      readLoop()
      if (port) {
        // successful connection
      }
    }
  }

What could the problem be here?

Source: Ask Javascript Questions

One Reply to “Web Serial API – Unhandled Rejection (TypeError): Failed to execute ‘open’ on ‘SerialPort’: required member baudRate is undefined”

LEAVE A COMMENT