White Screen on Fresh New Angular 8/Electron 5 App

前端 未结 2 893
死守一世寂寞
死守一世寂寞 2021-02-20 05:48

I am building and running an Angular 8/Electron 5 desktop app. After what I believe to be proper setup, running the app displays a blank white screen.

Using:
Electr

2条回答
  •  猫巷女王i
    2021-02-20 06:15

    I got my electron application to work by changing the target in the tsconfig.json to es5.

    {
      "compileOnSave": false,
      "compilerOptions": {
        "importHelpers": true,
        "module": "esnext",
        "outDir": "./dist/out-tsc",
        "sourceMap": true,
        "declaration": false,
        "moduleResolution": "node",
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "es5", <-- HERE
        "typeRoots": [
          "node_modules/@types"
        ],
        "lib": [
          "es2017",
          "dom"
        ]
      }
    }
    

    Prior to this, I was getting the blank (white) screen too after updating the Angular 8. Seems now that Angular does a build in both es5 and es2015, electron doesn't like that. I would guess this will be fixed in the future.

    UPDATE 2019-10-24:

    Looks like this was fixed in electron@7.0.0. You can target es2015 with that version. Tested with @angular/cli@8.3.14.

提交回复
热议问题