diff --git a/packages/bruno-app/package.json b/packages/bruno-app/package.json index b23d74594..c3f82569f 100644 --- a/packages/bruno-app/package.json +++ b/packages/bruno-app/package.json @@ -3,7 +3,7 @@ "version": "0.3.0", "private": true, "scripts": { - "dev": "cross-env ENV=dev next dev", + "dev": "cross-env ENV=dev next dev -p 3000", "build": "next build && next export", "start": "next start", "lint": "next lint", diff --git a/packages/bruno-app/src/pages/_app.js b/packages/bruno-app/src/pages/_app.js index 0b2f9c3a4..0437555cd 100644 --- a/packages/bruno-app/src/pages/_app.js +++ b/packages/bruno-app/src/pages/_app.js @@ -41,6 +41,15 @@ function MyApp({ Component, pageProps }) { return null; } + if (!window.ipcRenderer) { + return ( +
+ Error: "ipcRenderer" not found in window object. You most likely opened Bruno inside your web browser. Bruno + only works within Electron, you can start Electron using "npm run dev:electron". +
+ ); + } + return ( diff --git a/packages/bruno-electron/src/index.js b/packages/bruno-electron/src/index.js index f7cb3acc0..602517b5b 100644 --- a/packages/bruno-electron/src/index.js +++ b/packages/bruno-electron/src/index.js @@ -67,7 +67,21 @@ app.on('ready', async () => { slashes: true }); - mainWindow.loadURL(url); + mainWindow.loadURL(url).catch((reason) => { + console.error(`Error: Failed to load URL: "${url}" (Electron shows a blank screen because of this).`); + console.error('Original message:', reason); + if (isDev) { + console.error( + 'Could not connect to Next.Js dev server, is it running?' + + ' Start the dev server using "npm run dev:web" and restart electron' + ); + } else { + console.error( + 'If you are using an official production build: the above error is most likely a bug! ' + + ' Please report this under: https://github.com/usebruno/bruno/issues' + ); + } + }); watcher = new Watcher(); const handleBoundsChange = () => {