require(electron) doesn't work with eel.start
See original GitHub issueMy code:
const electron = require('electron');
const url = require('url');
const path = require('path');
const {app, BrowserWindow, Menu} = electron;
let mainWindow;
//Listen for app to be ready
app.on('ready', function(){
//Create new window
mainWindow = new BrowserWindow({});
//Load HTML into window
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol:'file',
slashes: true
}));
//Using the menu Template we made down outside this funciton
const mainMenu = Menu.buildFromTemplate(menuTemplate);
//Insert the Menu
Menu.setApplicationMenu(mainMenu);
});
//Creating a menu template.
//This is what shows up on the menubar on top.
const menuTemplate = [
{
label: 'Connection Management',
submenu:[
{
label: 'Start Listening',
click(){
dumbpy();
}
},
{
label: 'Stop Listening'
},
{
label: 'EDAAC'
}
]
}
]
The menu only shows when I do npm start
in the director. It doesn’t when I run the .py
file. When I open the the inspect element, I get this : Uncaught ReferenceError: require is not defined at main.js:1
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
require(electron) doesn't work with eel.start · Issue #148 - GitHub
require (electron) doesn't work with eel.start #148. Closed. CyberSinister opened this issue on May 28, 2019 · 10 comments.
Read more >Uncaught ReferenceError: require is not defined with EEL
I am Trying to run html page with electron + eel. I have successfully loaded the webpage + eel.js. My Problem is whenever...
Read more >Eel - Bountysource
Eel. A little Python library for making simple Electron-like HTML/JS GUI apps ... easily used to reproduce the problem or understand what I...
Read more >eelJINJAenv · PyPI
Eel is not as fully-fledged as Electron or cefpython - it is probably not suitable ... Additional options can be passed to eel.start()...
Read more >Eel options - DEV Community
start line, application will be blocked, thus, remaining code won't be executed. If you want to run eel and not get stuck at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi guys, I will post an example Electron demo this evening that you can copy
@CyberSinister Did you just download the folder then run
npm install
? I can’t tell if you can’t get the demo working or you tried editing your current program to add some stuff from the demo.