You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Infinite loop detection triggers on await loadImage etc in setup #4295
When the await-in-loop sketch throws an error, it looks like firstError.data[0] ends up undefined when this runs, causing Cannot read properties of undefined (reading 'toString') and crashing the whole Editor component — rather than just showing a normal console error. There are likely two things going on: whatever's actually throwing when await is used inside a for loop in setup() (the root cause), and this line not defensively checking firstError.data[0] exists before calling .toString() on it (which turns a normal error into a full component crash). Happy to dig into what's actually throwing on the loop side if that's useful, or take a stab at hardening this line as a quick follow-up fix.
This throws when firstError.data[0] is undefined, turning what should be a normal console error into a full Editor crash. I'd like to submit a defensive fix for this specific line (adding a safety check before calling .toString()) — separate from investigating the root cause of what's throwing in the loop-protect logic. Could I get assigned to this, or is it okay to just open a PR for this specific fix?
Activity
sarthaklole commentedon Sep 10, 2026
hi
I like to take this issue
Fix infinite loop detection false trigger on await in loops (processi…
ANUBHAVSINGH30 commentedon Sep 14, 2026
Dug into this further — the crash traces to client/modules/IDE/components/Editor/index.jsx around line 222:
js
const errorObj = { stack: firstError.data[0].toString() };
When the await-in-loop sketch throws an error, it looks like firstError.data[0] ends up undefined when this runs, causing Cannot read properties of undefined (reading 'toString') and crashing the whole Editor component — rather than just showing a normal console error. There are likely two things going on: whatever's actually throwing when await is used inside a for loop in setup() (the root cause), and this line not defensively checking firstError.data[0] exists before calling .toString() on it (which turns a normal error into a full component crash). Happy to dig into what's actually throwing on the loop side if that's useful, or take a stab at hardening this line as a quick follow-up fix.
ANUBHAVSINGH30 commentedon Sep 25, 2026
Since finding this, I looked into the crash further and traced it to a specific line in client/modules/IDE/components/Editor/index.jsx:
js
const errorObj = { stack: firstError.data[0].toString() };
This throws when firstError.data[0] is undefined, turning what should be a normal console error into a full Editor crash. I'd like to submit a defensive fix for this specific line (adding a safety check before calling .toString()) — separate from investigating the root cause of what's throwing in the loop-protect logic. Could I get assigned to this, or is it okay to just open a PR for this specific fix?
yashgoyal0110 commentedon Oct 3, 2026
Hey @clairep94
can i take this one?
dhowe commentedon Oct 14, 2026
students are reporting the same issue here - any status on this?