Electron window doesn't open but doesn't show any errors


Jeff

Context: I 've seen this question, but it doesn't solve my problem.

When I try to run my electron app, I don't get any errors and it seems to compile, but the electron window doesn't pop up.

Reply:

Date: 2019-05-08T03:02:22.036Z
Hash: 3303fd48d099a538493f
Time: 13840ms
chunk {0} runtime.26209474bfa8dc87a77c.js (runtime) 1.41 kB [entry] 
[rendered]
chunk {1} es2015-polyfills.c5dd28b362270c767b34.js (es2015-polyfills) 
56.4 kB [initial] [rendered]
chunk {2} main.8b6835f39caf5eafd09d.js (main) 276 kB [initial] 
[rendered]
chunk {3} polyfills.8bbb231b43165d65d357.js (polyfills) 41 kB [initial] 
[rendered]
chunk {4} styles.3ff695c00d717f2d2a11.css (styles) 0 bytes [initial] 
[rendered]

^ Seems to be a perfectly normal reaction

After a while, it exits without any error code.

Main file:

const { app, BrowserWindow } = require ('electron')

let win;

function createWindow() {
    //Create the browser window
    win = new BrowserWindow({
        width: 600,
        height: 600,
        backgroundColor: '#ffffff',
        //icon: 'file:///' + __dirname + '/dist/assets/favicon.ico'
    })

    win.loadURL('file:///' + __dirname + '/index.html')
    win.on('close', function() {
        win = null
    })
}

// Create window on electron intialization
app.on('ready', createWindow)

//Quit when all windows are closed
app.on('window-all-closed', function(){

    // On macOS specific close process
    if(process.platform !== 'darwin'){
        app.quit()
    }
})

app.on('activate', function(){
    //macOS specific close process
    if(win === null){
        createWindow()
    }
}) 

HTML file:

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>Bot</title>
      <base href="./">
    
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="icon" type="image/x-icon" href="favicon.ico">
    </head>
    <body>
      <app-root></app-root>
    </body>
    </html>
     

Package.json file:

{
  "name": "shopify-bot",
  "version": "0.0.0",
  "license": "MIT",
  "main": "main.js",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "electron": "electron .",
    "electron-build": "ng build --prod"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "core-js": "^2.5.4",
    "node-html-parser": "^1.1.15",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.13.9",
    "@angular/cli": "~7.3.8",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "electron": "^5.0.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.2.2"
  }
}

I am very new to angular so any help would be greatly appreciated!

Jeff

I figured out my mistake. I basically lost support for 4 corners from this outdated youtube video following the instructions, after I read and followed the instructions from this article, I was finally able to open a window.

Related


Intellij doesn't show any errors/suggestions on syntax

Bartosz_76 There are several similar threads, but none seem to contain an answer to my question. My IDE doesn't show any errors, doesn't give any suggestions, and doesn't import anything. example: public static String createInversion(ArrayList<String> splitNam

Why doesn't CPP Check show any errors?

Maug said to restore Monica this cppcheck --enable=style --inconclusive --check-config --xml --xml-version=2 -v -I.. -I../mocks -I../gmock -I../gtest -DUNIT_TEST ../src result <?xml version="1.0" encoding="UTF-8"?> <results version="2"> <cppcheck version="1

MSBuild won't deploy and doesn't show any errors

Mohammad Rostami Sehqli I am trying to publish my project using MSBuild. This is an order: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" D:\HamrahFarda\KhandeShow\KhandeShow.sln /t:UserService /p:DeployOnBuild=tru

MSBuild won't deploy and doesn't show any errors

Mohammad Rostami Sehqli I am trying to publish my project using MSBuild. This is an order: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" D:\HamrahFarda\KhandeShow\KhandeShow.sln /t:UserService /p:DeployOnBuild=tru

Django form doesn't show any errors and is invalid

Theo Lavaux To create a form on my website, I create some models corresponding to fields. Then I created ModelForms from them, some views and templates. My problem is that I never see the form error in the first place, and second, the form for this particular

Python asyncio doesn't show any errors

superman I am trying to get some data from thousands of URLs by using asyncio. Here is a brief overview of the design: QueuePopulate a bunch of URLs at once with one URLProducer generate a bunchConsumers Each Consumerkeeps fetching urls from Queueand sending G

Electron window doesn't open but doesn't show any errors

Jeff Context: I 've seen this question, but it doesn't solve my problem. When I try to run my electron app, I don't get any errors and it seems to compile, but the electron window doesn't pop up. Reply: Date: 2019-05-08T03:02:22.036Z Hash: 3303fd48d099a538493f

ionic cordova doesn't build but doesn't show any errors

Tristan I just made a "new" ionic app, but I can't get Cordova to build the APK. I put the new quotes because I created a new project and copied over from the previous project's src. Something went horribly wrong with the dependencies of the plugin installed o

Intellij doesn't show any errors/suggestions on syntax

Bartosz_76 There are several similar threads, but none seem to contain an answer to my question. My IDE doesn't show any errors, doesn't give any suggestions, and doesn't import anything. example: public static String createInversion(ArrayList<String> splitNam

Ajax doesn't work. it doesn't show any errors

Ati I am using Ajax in my application. Previously it worked fine and checked many times. Not working now. I didn't change anything in this code. I checked the URL path and also checked the Jquery click event. It doesn't show any errors in the console log. $(".

MSBuild won't deploy and doesn't show any errors

Mohammad Rostami Sehqli I am trying to publish my project using MSBuild. This is an order: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" D:\HamrahFarda\KhandeShow\KhandeShow.sln /t:UserService /p:DeployOnBuild=tru

Electron window doesn't open but doesn't show any errors

Jeff Context: I 've seen this question, but it doesn't solve my problem. When I try to run my electron app, I don't get any errors and it seems to compile, but the electron window doesn't pop up. Reply: Date: 2019-05-08T03:02:22.036Z Hash: 3303fd48d099a538493f

Python asyncio doesn't show any errors

superman I am trying to get some data from thousands of URLs by using asyncio. Here is a brief overview of the design: QueuePopulate a bunch of URLs at once with one URLProducer generate a bunchConsumers Each Consumerkeeps fetching urls from Queueand sending G

PHP doesn't show any errors

UserIsCorrupt I know this question has been asked many times in the past, but none of the solutions worked for me. Here is my PHP code: <?php function ?> This should generate an error. However, it just returns a 500 error and doesn't load. I tried the less

Python asyncio doesn't show any errors

superman I am trying to get some data from thousands of URLs by using asyncio. Here is a brief overview of the design: QueuePopulate a bunch of URLs at once with one URLProducer generate a bunchConsumers Each Consumerkeeps fetching urls from Queueand sending G

MSBuild won't deploy and doesn't show any errors

Mohammad Rostami Sehqli I am trying to publish my project using MSBuild. This is an order: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" D:\HamrahFarda\KhandeShow\KhandeShow.sln /t:UserService /p:DeployOnBuild=tru

ionic cordova doesn't build but doesn't show any errors

Tristan I just made a "new" ionic app, but I can't get Cordova to build the APK. I put the new quotes because I created a new project and copied over from the previous project's src. Something went horribly wrong with the dependencies of the plugin installed o

Python asyncio doesn't show any errors

superman I am trying to get some data from thousands of URLs by using asyncio. Here is a brief overview of the design: QueuePopulate a bunch of URLs at once with one URLProducer generate a bunchConsumers Each Consumerkeeps fetching urls from Queueand sending G