ConardLi/electron-react

关于Electron升级到4.0+的问题

Opened this issue · 2 comments

electron 升级到相对新的4.0.3后,无法启动项目

开始遇到 app.makeSingleInstance(cb)' is deprecated ,not a function的报错,
查询是方法经过变动,替换为app.requestSingleInstanceLock()后通过,

然后依据提示将component-class/index.js下的
var index = require('indexof');换为
var index = require('component-indexof');

此时CLI显示 webpack: Compiled successfully.,但仍然没有程序窗口弹出

大佬可以帮忙看看吗

  • 补充

compile之前行输出的报错,会不会跟这里的类型error有关系?

(node:18512) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at maybeCallback (fs.js:129:9)
at Object.writeFile (fs.js:1137:14)
at D:\mydev\electron-react\main_process\utils\deviceid.js:91:16
at process._tickCallback (internal/process/next_tick.js:68:7)

(node:18512) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:18512) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

2.0.0 这个版本确实太旧了,在最新的 win10 1903 上有很多问题,希望能升级一下版本