Replies: 2 comments 20 replies
-
Converted to a discussion because that's not a bug but a misunderstanding on your part. You don't |
Beta Was this translation helpful? Give feedback.
20 replies
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version
v18.18.0
Platform
x64 window
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Occasionally, and inconsistently across executions.
What is the expected behavior? Why is that the expected behavior?
entering the fetchSlowData function
promise_2 Promise { }
entering the fetchData function
promise_1 Promise { }
checking_1
checking_2
checking_3
Ending
API_2 is coming
API_1 is coming
What do you see instead?
entering the fetchSlowData function
promise_2 Promise { }
entering the fetchData function
promise_1 Promise { }
checking_1
checking_2
checking_3
Ending
API_1 is coming
API_2 is coming
Additional information
hi You, in this piece of code, I intentionally want to notify 'API_2 is coming' first, so I placed the 'sleep()' function inside the 'call_api_1' function. However, when I run it on Node v18, I receive a strange result where sometimes 'API_2 is coming' appears first, and other times 'API_1 is coming' appears first on the screen. But when I check it in the Chrome browser, I consistently get the result 'API_2 is coming' first. I've tried to explain it, but I don't know the reason why. It seems to be a Node.js issue.
thank you!
Beta Was this translation helpful? Give feedback.
All reactions