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
// a.jsexportconstutilityFunction=()=>{return'woah nice utility';}process.on('exit',(exitCode)=>{// This prints 0 but the correct code should be 13console.log('exitCode',exitCode);});try{constdefaultImpB=(awaitimport('./b.js')).default;console.log('try');console.log({defaultImpB});}catch(e){console.log('catch')}finally{console.log('finally');}// b.jsimport{utilityFunction}from'./a.js';consttest=()=>{return'test';}exportdefaulttest;
# This prints exit code 0
node a.js
# This prints exit code 13echo$?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
exitCode should return 13 code
What do you see instead?
exitCode returns 0
Additional information
There is #44601 issue which talks about early exit. But my main concern was the exitCode being 0 since there is no other way to debug this issue when process exits with success code
The text was updated successfully, but these errors were encountered:
fix listeners registered via `process.on('exit', ...` not receiving
error code 13 when an unsettled top-level-await is encountered in
the code
PR-URL: #56872Fixes: #53551
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
fix listeners registered via `process.on('exit', ...` not receiving
error code 13 when an unsettled top-level-await is encountered in
the code
PR-URL: #56872Fixes: #53551
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
fix listeners registered via `process.on('exit', ...` not receiving
error code 13 when an unsettled top-level-await is encountered in
the code
PR-URL: #56872Fixes: #53551
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Version
20.15.0
Platform
Darwin Saurabhs-MacBook-Air.local 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103 arm64
Subsystem
No response
What steps will reproduce the bug?
CodeSandbox Reproduction
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
exitCode should return 13 code
What do you see instead?
exitCode returns 0
Additional information
There is #44601 issue which talks about early exit. But my main concern was the exitCode being 0 since there is no other way to debug this issue when process exits with success code
The text was updated successfully, but these errors were encountered: