-
-
Notifications
You must be signed in to change notification settings - Fork 571
Uncaught TypeError When Calling Bunch of echo in a Loop #878
Description
Issue summary
I am just printing a bunch of strings line by line to the terminal using echo and got into this error every time:
null:10460 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at null:10460:59
at FormatBuffer.forEach (null:1976:17)
at FormatBuffer.flush (null:1982:14)
at ready (null:10414:32)
at DelayQueue.add (null:256:17)
at null:9364:23
at jQuery.fn.init.flush (null:10395:17)
at jQuery.fn.init.flush (null:11486:32)
at null:10781:42
at unpromise (null:1136:20)
It is pointing to this line number 10460 (line 10390 in the source code) =>
jquery.terminal/js/jquery.terminal.js
Line 10390 in ef9b638
| snapshot[snapshot.length - 1] += data.raw; |
I don't think I can re-produce this error. But you can check out the Gif below

Noted: all the white colored string characters come from a serial COM port.
The weird thing is this error ONLY occurs on the 18th index of the for loop.
This error cause the terminal to stop receiving data from the echo method until I type clear in the terminal then everything works again.
I was hoping you can give me some ideas why is the snapshot was undefined at that point, so I can track down what causing this in my end.
Thanks,