python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.3k stars 580 forks source link

Error while run Eel with Electron #606

Closed pham-tuyen closed 1 year ago

pham-tuyen commented 1 year ago

Eel version 0.14.0

Describe the bug I run my main.py and I saw this bug: image

Code main.py

eel.init('src')
eel.start('index.html', mode='electron')

main.js


function createWindow () {
  const mainWindow = new BrowserWindow({
    autoHideMenuBar: true
  })
  mainWindow.loadURL('http://localhost:8000/index.html)
  mainWindow.maximize()
}

app.whenReady().then(() => {
  createWindow()
  app.on('activate', function () {
    if (BrowserWindow.getAllWindows().length === 0) createWindow()
  })
})

app.on('window-all-closed', function () {
  if (process.platform !== 'darwin') app.quit()
})

Reproduce py main.py

Desktop (please complete the following information):

pham-tuyen commented 1 year ago

OK, I found that because I haven't installed Electron globally yet.