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

DMG build fails if internetEnabled, v7.1.10 with node v13.7 #4639

Closed
grumpygary opened this issue Feb 4, 2020 · 8 comments
Closed

DMG build fails if internetEnabled, v7.1.10 with node v13.7 #4639

grumpygary opened this issue Feb 4, 2020 · 8 comments

Comments

@grumpygary
Copy link

grumpygary commented Feb 4, 2020

Which version of electron-builder:
7.1.10

Which version of electron-updater:
4.2.0

Node version:
13.7 (note: the build also fails with node LTS v12.14.1)

Target:
MacOS DMG

Build works fine if !internetEnabled. If internetEnabled == true, it fails with: "require(...).split is not a function" in dmg.ts, line 61 (which I believe is transpiled into dmg.js, line 165, where require("os").split(".") is used.

My assumption is that this has to do with the node version, since the call is looking for the first element in the split array. If I call "require("os").split(".")" in my main/index.js it throws the same exception.

@kzimny
Copy link

kzimny commented Feb 4, 2020

Try to build with v.22.3.2 of electron-builder.

@grumpygary
Copy link
Author

oops. I was incorrect above:

electron is 7.1.10 (latest)
electron-builder is 22.3.3 (which is later than your suggestion)

BTW, thanks for the rapid response!

@grumpygary
Copy link
Author

grumpygary commented Feb 4, 2020

BTW, getting production builds to work like the dev builds do is a real challenge. Do you know where to find an overview of the various production paths -- by platform -- for: the app root (my app files are in a folder off of that), as well as user data files? Your docs are technically correct, but how the production apps differ from the dev version could use a separate explanation (and might reduce reported issues).

@grumpygary
Copy link
Author

Um... I just checked again (to make sure), and I am using 22.3.2. Oops...

@CharonTao
Copy link

Um,I had the same problem。Then I checked the source code of the electron builder git repository。I find it.
if (this.options.internetEnabled && parseInt(require("os").split(".")[0], 10) < 19) { await exec("hdiutil", addLogLevel(["internet-enable"]).concat(artifactPath)) }
'require("os")' is Object , You can't use “split” method

@stale
Copy link

stale bot commented May 9, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label May 9, 2020
@jhbsa
Copy link
Contributor

jhbsa commented May 10, 2020

I just updated electron-builder to latest (22.6.0) on MacOS Catalina and am receiving this same error - which consequently fails the build. I would say it is still relevant Mr. Stalebot.

@stale stale bot removed the backlog label May 10, 2020
@jhbsa
Copy link
Contributor

jhbsa commented May 10, 2020

as a followup, I believe the intended code should have been:
parseInt(require("os").release().split(".")[0], 10)

Now I just need to figure out how to create a pull request and get it approved - which turned out to be very easy (at least the pull request part ;)

jhbsa added a commit to jhbsa/electron-builder that referenced this issue May 10, 2020
Prior commit did not properly reference the desired os.release() function and caused dmg build to fail.
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

4 participants