Skip to content

Uncaught TypeError When Calling Bunch of echo in a Loop #878

@KiddoV

Description

@KiddoV

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) =>

snapshot[snapshot.length - 1] += data.raw;

I don't think I can re-produce this error. But you can check out the Gif below
term-error

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugresolvedif issue is resolved, it will be open until merge with master

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions