tamkeen-tms / electron-window-manager

A NodeJs module that handles window management for Electron (Atom Shell, previously).
MIT License
397 stars 65 forks source link

Unable to load the application interface #70

Open koenhendriks opened 5 years ago

koenhendriks commented 5 years ago

I'm just trying out this package, it looks promising but i can't even get a simple window to work.

Using basic code:

const {app, BrowserWindow} = require('electron');
const windowManager = require('electron-window-manager');

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

app.on('ready', function() {
    windowManager.init();
    windowManager.setDefaultSetup({'width': 600, 'height': 450, 'position': 'right'});
    windowManager.open('main', 'main test', './index.html');
});

I get the following error: screenshot 2019-01-11 at 16 00 12

nikoc2016 commented 5 years ago

remove . from html directory will solve your problem

nikoc2016 commented 5 years ago

windowManager.open('main', 'main test', '/index.html');

benhk2005 commented 5 years ago

Same issue here, even i use windowManager.open('main', 'main test', '/index.html');

its the same

anderzilla commented 5 years ago

Hi Guys,

This problem make me lose my head kkk. I fix it but... This message is because the source or url is not finded. In my code it's set in: process.env.NODE_ENV === "development" ? envDEV + /trChamada" : 'file://${__dirname}/index.html#trChamada;'

trChamada is the igual to my route to fix it: { path: "/trChamada", name: "tr-chamada", component: require("@/components/Paginas/TrChamada").default },

I lose half day work to find this and solve it. Take care by names and routes to prevent this.

IntellyCode commented 4 years ago

I am sry, but where did you change this code. In main.js, or index.html there is nothing. Did you change something in package.json? I searched all the main code files and i didn't find a single line of code even similar to this.