Version
v20.10.0
Platform
No response
Subsystem
seems loader init the esm builtin from cjs, which shown on process because only process module can be accessed before require/import.
What steps will reproduce the bug?
process.default = 1;
require('process');// crash
process.default = 1;
import('process');// crash
require('process');
process.default = 1;
require('process');// ok
import('process');// ok
process.x = 1;
import('process').then(processModule => {
console.log('x' in processModule);// true
});
How often does it reproduce? Is there a required condition?
every time.
What is the expected behavior? Why is that the expected behavior?
don't crash. and esm version should not use the modified cjs version to init its module names, if I'm right.
What do you see instead?
crash (even not throw).
Additional information
No response