fix: asar integration for require('node:child_process') (#38742)

This commit is contained in:
Milan Burda 2023-06-14 11:03:53 +02:00 committed by GitHub
parent 46458ab517
commit dc2e822dc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 51 deletions

View file

@ -838,7 +838,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
const originalModuleLoad = Module._load;
Module._load = (request: string, ...args: any[]) => {
const loadResult = originalModuleLoad(request, ...args);
if (request === 'child_process') {
if (request === 'child_process' || request === 'node:child_process') {
if (!asarReady.has(loadResult)) {
asarReady.add(loadResult);
// Just to make it obvious what we are dealing with here