Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not use compressing@1.5.0+ in electron #48

Open
Pevernow opened this issue Jun 13, 2020 · 1 comment
Open

Can not use compressing@1.5.0+ in electron #48

Pevernow opened this issue Jun 13, 2020 · 1 comment

Comments

@Pevernow
Copy link

Pevernow commented Jun 13, 2020

在electron 中使用compressing解压zip 时报错
Uncaught ReferenceError: setImmediate is not defined

在preload.js中引入
var compressing = require("compressing"); var fs = require("fs"); var path = require("path"); var request = require("request");

@Pevernow
Copy link
Author

解决办法
在preload中添加

var _setImmediate = setImmediate;
process.once('loaded', function() {
  global.setImmediate = _setImmediate;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant