Change:
Issue Type: <bBug</bCan any one explain why vs code debug console work like this: when I use for logging name form array using map, at first log it work. On second log its not showing VS Code version: Code 1.57.1 (, 2021-06-17T13:28:07.755Z) OS version: WindowsNT x64 10.0. Restricted Mode: No <details<summarySystem Info</summary </details<details<summaryExtensions (9)</summaryExtensionVersion ------ insert-unicode0.10.0 bracket-pair-colorizer1.0.61 vscode-markdownlint0.40.4 code-runner0.11.4 js-debug-nightly2021.5.617 material-icon-theme4.7.0 LiveServer5.6.1 vscodeintellicode1.2.14 JavaScriptSnippets1.8.0 </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
! It work fine with JavaScript debug terminal !
This works for me, can you reproduce with vscode insiders If yes, can you please share a sample short code that I can just copy and try to reproduce? Thanks
If I use or it work (logs) fine as expected but if I debug using Vscode it's only log first
Thanks for the repro steps. I can reproduce this. The issue seems to be how we are handling events here We should fix this, but I will not have time this milestone, thus adding help wanted, and if no nobody from the community helps I can look into it next milestone.
Hi ~ I create a PR to fixes this issue, maybe u can have a look
This duplicates and has the potential to be fixed by The PR makes a race slightly less likely but doesn't fix the issue, which can still be hit with slow enough processing or large enough output. The PR does have the potential to improve performance in general so I think it's worth taking in some form, but it won't fix this issue globally.

Discussion:
const outputQueue = new Queue<void>(); this.rawListeners.push(this.raw.onDidOutput(async event => { <ins> // When a variables event is received, execute immediately to obtain the variables value #126967 if (event.body.variablesReference) { const source = event.body.source && event.body.line ? { lineNumber: event.body.line, column: event.body.column ? event.body.column : 1, source: this.getSource(event.body.source) } : undefined; const container = new ExpressionContainer(this, undefined, event.body.variablesReference, generateUuid()); const children = container.getChildren(); // we should put appendToRepl into queue to make sure the logs to be displayed in correct order // see https://github.com/microsoft/vscode/issues/126967#issuecomment-874954269 outputQueue.queue(async () => { const resolved = await children; resolved.forEach((child) => { // Since we can not display multiple trees in a row, we are displaying these variables one after the other (ignoring their names) (<any>child).name = null; this.appendToRepl(child, severity.Info, source); }); }); return; } </ins> outputQueue.queue(async () => { if (!event.body || !this.raw) { return;

} } <del> if (event.body.variablesReference) { const container = new ExpressionContainer(this, undefined, event.body.variablesReference, generateUuid()); await container.getChildren().then(children => { children.forEach(child => { // Since we can not display multiple trees in a row, we are displaying these variables one after the other (ignoring their names) (<any>child).name = null; this.appendToRepl(child, outputSeverity, source); }); }); } else if (typeof event.body.output === 'string') { </del> <ins> if (typeof event.body.output === 'string') { </ins> this.appendToRepl(event.body.output, outputSeverity, source); } });