fix: call initializeShellEnv directly in app ready handler (#7228)

Move the shell environment initialization from module-level into the
app ready callback, avoiding a dangling promise at import time.
This commit is contained in:
lohit
2026-02-19 19:58:22 +00:00
committed by GitHub
parent 0376d38860
commit cd33cb76fb

View File

@@ -5,9 +5,6 @@ const isDev = require('electron-is-dev');
const os = require('os');
const { initializeShellEnv } = require('@usebruno/requests');
// Fetch shell environment early (before app ready)
const shellEnvPromise = initializeShellEnv();
if (isDev) {
if (!fs.existsSync(path.join(__dirname, '../../bruno-js/src/sandbox/bundle-browser-rollup.js'))) {
console.log('JS Sandbox libraries have not been bundled yet');
@@ -160,7 +157,7 @@ if (useSingleInstance && !gotTheLock) {
// Prepare the renderer once the app is ready
app.on('ready', async () => {
// Ensure shell environment is loaded before any operations that need it
await shellEnvPromise;
await initializeShellEnv();
if (isDev) {
const { installExtension, REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer');