Add console logging for debugging load issues

This commit is contained in:
Alex Gleason committed 2025-10-24 22:47:45 -05:00
1 parent 3765e8f8c0
commit 8bc7fe7aeb
1 file changed
+12
+12
View File
@@ -53,14 +53,26 @@ function createWindow() {
// Load the app
if (process.env.ELECTRON_DEV) {
// Development mode - load from Vite dev server
console.log('Loading from Vite dev server: http://localhost:5173');
mainWindow.loadURL('http://localhost:5173');
mainWindow.webContents.openDevTools();
} else {
// Production mode - load from custom protocol
// This allows absolute paths like /shakespeare.svg to work naturally
console.log('Loading from app:// protocol: app://index.html');
mainWindow.loadURL('app://index.html');
}
// Log any load errors
mainWindow.webContents.on('did-fail-load', (event, errorCode, errorDescription, validatedURL) => {
console.error('Failed to load:', validatedURL, errorCode, errorDescription);
});
// Log successful load
mainWindow.webContents.on('did-finish-load', () => {
console.log('Successfully loaded app');
});
// Handle window close
mainWindow.on('closed', () => {
mainWindow = null;