-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug Console: wrong order of incoming input #33822
Comments
This is just the order the order in which node is emitting events. Not sure if we can do anything here, though assigning to @roblourens since I see you are using the inspector protocol. |
The output events come back from the adapter in the right order, but they seem to get reordered by the console when it resolves the variables. If the log statement is |
I acknowledge the bug, the issue is that vscode gets an object as output from The fix would be to remember the events in which they came and append them to the repl in that order. This has the downside that if some object takes a long time to resolve all subsequent output will be stuck. |
Thanks for your answer. |
Can't the object be inserted in the right position, once it's resolved, while still appending other output? This seems like a really bad bug - having logs in the wrong order could make someone waste a lot of time debugging. |
Yes, we could insert it in the right position by changing the |
@isidorn Possibly related to this defect and hopefully helpful: I bumped into an issue where console.log() and console.error() messages consistently appear out of order in the VS Code JavaScript DEBUG CONSOLE. The isolated code below demonstrates the observation. Has NOT been observed outside of the DEBUG CONSOLE (not when running Node.js from the command prompt; not in Chrome web browser). Thanks! Particulars:
The VS Code DEBUG CONSOLE: |
@good-bits yeah, this seem to be the same issue. Assigning to November to investigate into a fix. |
@isidorn Thanks! |
I agree with Rob that this is really a bad bug that we should fix: logs are for troubleshooting bugs not for making the troubleshooting more difficult... |
@good-bits I have investigated into your issue and it is actually not the same as the one from above. To be more precise the issue is in the debug adapter - it is sending the events in the wrong order. To track this issue I have created #37770 Keeping this open as this is a different issue explained in my comment above and I will investigate in a fix. |
@isidorn @roblourens @weinand Thank you so much! |
Runtime environment
Description
I want to add "After sort:" between source arry and sort arry, look like this:
But console occasionally shows:
Why for-of-loop has not finished running, jump out to run console.log ? Source code:
If i change my code like this:
This bug will still appear:
The text was updated successfully, but these errors were encountered: