-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron | Blank window after build #61
Comments
Hi i faced the same issue did you fix. If you fixed it please explain |
Hi Muhammad, |
Hi!
I'm using gulp-connect-php for the first time. During my Electron app dev, everything was perfectly working. But, after running the build, I got a blank white window when opening the app. It seems that the app is not able to load the local url:
mainWindow.loadURL("http://127.0.0.1:8000")
instead of traditional:
mainWindow.loadURL('file://' + __dirname + '/index.html')
Here is my main.js
`const electron = require('electron');
const app = electron.app;
const { Menu, MenuItem } = electron;
const { ipcMain } = require('electron');
connect = require("gulp-connect-php");
var con = connect.server({
port: 8000,
hostname: "127.0.0.1",
base: 'public',
keepalive: false,
open: false,
root: "/",
stdio: "inherit"
});
const BrowserWindow = electron.BrowserWindow;
var mainWindow = null;
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit();
}
});
app.on('ready', function() {
mainWindow = new BrowserWindow({
width: 800,
height: 800,
frame: false,
webPreferences: {
plugins: true,
nodeIntegration: true
}
});
mainWindow.maximize();
mainWindow.loadURL("http://127.0.0.1:8000");
mainWindow.on('closed', function() {
mainWindow = null;
});
Menu.setApplicationMenu(null);
});`
It works well, but only when developing the app. I'm using electron-builder.
Maybe that's not an issue. Is there something wrong with this code ?
Thanks
EDIT : I should precise the entry file of my app is /public/index.php
The text was updated successfully, but these errors were encountered: