Closed
Description
Version
v20.6.1
Platform
Darwin
Subsystem
snapshots
What steps will reproduce the bug?
Generate a snapshot of the given script, then run it from a different directory. The process.cwd()
function will keep returning the cwd you had while building the snapshot.
const v8 = require(`v8`);
if (v8.startupSnapshot.isBuildingSnapshot()) {
v8.startupSnapshot.setDeserializeMainFunction(() => {
console.log(process.cwd());
});
}
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
It should return the actual cwd.
What do you see instead?
It returns the cwd at the time of --build-snapshot
.
Additional information
No response