-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
loadersIssues and PRs related to ES module loadersIssues and PRs related to ES module loadersprocessIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.
Description
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?
// a.js
export const utilityFunction = () => {
return 'woah nice utility';
}
process.on('exit', (exitCode) => {
// This prints 0 but the correct code should be 13
console.log('exitCode', exitCode);
});
try {
const defaultImpB = (await import('./b.js')).default;
console.log('try');
console.log({defaultImpB});
} catch (e) {
console.log('catch')
} finally {
console.log('finally');
}
// b.js
import { utilityFunction } from './a.js';
const test = () => {
return 'test';
}
export default test;
# This prints exit code 0
node a.js
# This prints exit code 13
echo $?
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
tonivj5
Metadata
Metadata
Assignees
Labels
loadersIssues and PRs related to ES module loadersIssues and PRs related to ES module loadersprocessIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.