I am learning from google codelab example Getting started with the Web Serial API
The example is on glitch so I remixed the code and follow the instructions and copied and pasted these code
let decoder = new TextDecoderStream();
inputDone = port.readable.pipeTo(decoder.writable);
inputStream = decoder.readable;
reader = inputStream.getReader();
readLoop();