ELECTRON_RUN_AS_NODE is removed too late before bootstrap-amd.js redefines 'fs' (fix #225139) (#225141)

This commit is contained in:
Benjamin Pasero
2024-08-08 18:12:03 +02:00
committed by GitHub
parent 559107b7a9
commit b1a6f7e780
2 changed files with 8 additions and 4 deletions
+4 -3
View File
@@ -6,6 +6,10 @@
// @ts-check
'use strict';
// Keep bootstrap-amd.js from redefining 'fs'.
// TODO@esm this needs to be revisited in ESM
delete process.env['ELECTRON_RUN_AS_NODE'];
// ESM-comment-begin
const path = require('path');
const bootstrapNode = require('./bootstrap-node');
@@ -26,9 +30,6 @@ const product = require('./bootstrap-meta').product;
async function start() {
// Keep bootstrap-amd.js from redefining 'fs'.
delete process.env['ELECTRON_RUN_AS_NODE'];
// NLS
const nlsConfiguration = await resolveNLSConfiguration({ userLocale: 'en', osLocale: 'en', commit: product.commit, userDataPath: '', nlsMetadataPath: __dirname });
process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfiguration); // required for `bootstrap-amd` to pick up NLS messages
+4 -1
View File
@@ -11,6 +11,10 @@
* @import { IServerAPI } from './vs/server/node/remoteExtensionHostAgentServer'
*/
// Keep bootstrap-amd.js from redefining 'fs'.
// TODO@esm this needs to be revisited in ESM
delete process.env['ELECTRON_RUN_AS_NODE'];
// ESM-comment-begin
const path = require('path');
const http = require('http');
@@ -279,7 +283,6 @@ async function findFreePort(host, start, end) {
*/
function loadCode(nlsConfiguration) {
return new Promise((resolve, reject) => {
delete process.env['ELECTRON_RUN_AS_NODE']; // Keep bootstrap-amd.js from redefining 'fs'.
/** @type {INLSConfiguration} */
process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfiguration); // required for `bootstrap-amd` to pick up NLS messages