mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-11 08:28:14 +01:00
feat(#740): Add hints for local bruno setup
- Custom error when opening bruno in the browser - Custom error when starting electron without the web server running - Force Next dev server to use port 3000
This commit is contained in:
parent
5274d77660
commit
7b1223d2c5
@ -3,7 +3,7 @@
|
|||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env ENV=dev next dev",
|
"dev": "cross-env ENV=dev next dev -p 3000",
|
||||||
"build": "next build && next export",
|
"build": "next build && next export",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
|
@ -41,6 +41,15 @@ function MyApp({ Component, pageProps }) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!window.ipcRenderer) {
|
||||||
|
return (
|
||||||
|
<div style={{ color: 'red' }}>
|
||||||
|
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".
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<SafeHydrate>
|
<SafeHydrate>
|
||||||
|
@ -67,7 +67,21 @@ app.on('ready', async () => {
|
|||||||
slashes: true
|
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();
|
watcher = new Watcher();
|
||||||
|
|
||||||
const handleBoundsChange = () => {
|
const handleBoundsChange = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user