From cd33cb76fb602ccfc8e5ec4349b26429c42836d4 Mon Sep 17 00:00:00 2001 From: lohit Date: Thu, 19 Feb 2026 19:58:22 +0000 Subject: [PATCH] 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. --- packages/bruno-electron/src/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/bruno-electron/src/index.js b/packages/bruno-electron/src/index.js index cfd0985a0..24f72e21d 100644 --- a/packages/bruno-electron/src/index.js +++ b/packages/bruno-electron/src/index.js @@ -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');