TextDecoderStream is not defined in Web Serial Google Tutorial

I am trying to use the Web Serial experimental feature and when I try to create my own project and add this line:

let decoder = new TextDecoderStream();

I get the undefined error. Is there something in Glitch I need to set like a “uses” or “import” clause to tell it I am using this?

You need do define that functions from the package.

It seems to be a bug because the code works fine. Odd. How does one find out what package a function is in? Where does TextDecoderStream live? I am trying to learn this system to adapt it but am having to learn this language at the same time. I use C++ and it is very different.

I suggest you start with that. I thought you were using Node.js.

I’m sorry I wasn’t clear. I normally use C++, so this code and then entire environment is difficult to understand. I believe this code is JavaScript. I am using the glitch.com site to hold the code and then running it in a browser. It is in a .js file. I am trying to learn more JavaScrip and jQuery. Now node.js too, I suppose :wink: The interesting thing is I loaded the web page anyway and the code works. It is like the glitch environment itself has a “glitch”.