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

Windows Build ends with [object Object] #4045

Closed
Alnarra opened this issue Jul 12, 2019 · 28 comments
Closed

Windows Build ends with [object Object] #4045

Alnarra opened this issue Jul 12, 2019 · 28 comments
Labels

Comments

@Alnarra
Copy link

Alnarra commented Jul 12, 2019

  • Version: 21.0.15
  • Electron Updater Version:^4.1.2

  • Electron Version: 5.0.6

  • Target: Windows / nsis

When attempting to build for Windows on a Windows Native client The process proceeds as expected

• electron-builder version=21.0.15 os=10.0.17134
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=5.0.6 appOutDir=dist\win-unpacked
• building target=nsis file=dist\project.exe archs=x64 oneClick=true perMachine=false
⨯ [object Object]

And does not seem to make an exe of any kind in the /dist folder. There is no further information then [object Object]. It may be worth noting that when building the same project for Mac and Linux it completes successfully and without issue. I have also tried to make use of the docker image under the Multi Platform section, it ends with the same error when attempting to build for windows.

@Alnarra
Copy link
Author

Alnarra commented Jul 12, 2019

Corrected:

  • By downgrading to version 20.44.4 I was able to get the full error log which revealed that NSIS was not properly handling ${name} and other such variables where as the Linux and Mac versions did. I hard coded those values and set it back to 21.0.15 and it compiled.

@Alnarra Alnarra closed this as completed Jul 12, 2019
@dadiorchen
Copy link

@Alnarra I run into a problem like this too! I think this is a bug, in my case, the problem is the icon.ico file is wrong somehow. When I remove the ico file, packing will success, the bug is, in version 21.x.x the error message can not be shown successfully, (instead, [object object] was shown), so it is hard for the user to find what is wrong. And 20.x.x version has no problem like this.

@dadiorchen
Copy link

Maybe we should open this issue again to let maintainer notice this

@ghost
Copy link

ghost commented Jul 30, 2019

Same here. I had to downgrade as well. @Alnarra can you reopen this issue?

@Alnarra
Copy link
Author

Alnarra commented Jul 31, 2019

Per Request, Reopening

@Alnarra Alnarra reopened this Jul 31, 2019
@FabianAlvaradoDotCom
Copy link

Hello guys!
I just experienced this and for me it had to do with the icon, the error at the end of the logs:
• electron-builder version=21.1.1 os=10.0.17134
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=5.0.8 appOutDir=dist\win-unpacked
• building target=nsis file=dist\SomeApp Setup 1.0.0.exe archs=x64 oneClick=false perMachine=true
⨯ [object Object]

I created my icons with GIMP and what caused the issue to me was saving the icon files with no compression, so when I tried again but this time by checking "PNG compression" it went all good:

• electron-builder version=21.1.1 os=10.0.17134
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=5.0.8 appOutDir=dist\win-unpacked
• building target=nsis file=dist\SomeApp Setup 1.0.0.exe archs=x64 oneClick=false perMachine=true
• building block map blockMapFile=dist\SomeApp Setup 1.0.0.exe.blockmap

I hope it helps :)

@aziks
Copy link

aziks commented Aug 5, 2019

In my case I got this, anyone can help? I'm using a working NSIS custom script but I got this error

...
• uninstaller is not signed by electron-builder reason=custom NSIS script is used
⨯ [object Object]

@taduyde
Copy link

taduyde commented Aug 6, 2019

Hi @aziks,
I got the same issue with you. Did you know problem?

In my case I got this, anyone can help? I'm using a working NSIS custom script but I got this error

...
• uninstaller is not signed by electron-builder reason=custom NSIS script is used
⨯ [object Object]

@aziks
Copy link

aziks commented Aug 6, 2019

Hi @taduyde

I can't resolve this problem, but I think is realted to this #526

If someone can give some insight it would be awesome!

@taduyde
Copy link

taduyde commented Aug 8, 2019

Hi Every body,
Any update for this issue?

@sonerpyci
Copy link

Hi Folks, I'm facing the same problem.
Any update ?

@jackieli123723
Copy link

Illegal filename change to Normal filename

@ulvido
Copy link

ulvido commented Sep 18, 2019

same problem here. I am using 256x256 png for the icon. above solutions did not work for me.

<<<<< building for windows on linux >>>>

`

  • electron-builder version=21.2.0 os=4.15.0-64-generic
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=release/builder/builder-effective-config.yaml
  • packaging platform=linux arch=x64 electron=6.0.9 appOutDir=release/builder/linux-unpacked
  • building target=AppImage arch=x64 file=release/builder/ECZADO-0.0.1.AppImage
  • packaging platform=win32 arch=ia32 electron=6.0.9 appOutDir=release/builder/win-ia32-unpacked
  • building target=nsis file=release/builder/ECZADO Setup 0.0.1.exe archs=ia32 oneClick=false perMachine=false
  • ⨯ [object Object]
  • npm ERR! code ELIFECYCLE
  • npm ERR! errno 1

`

@CatsMiaow
Copy link

Using electron-builder: v21.2.0

#4045 (comment)
I checked the comments above.

https://forum.getkirby.com/t/how-to-make-a-proper-compressed-favicon-ico/2725
We fixed it by exporting the icon file to PNG compression as described in the link above.

@hudecekd
Copy link

I had same issue but for me nothing from above worked. I have tried PNG compression as mentioned above with no luck.
I have observed that I had very little free disc space on my SDD about 500 MB before build. It was no problem before but now I have tried to clean a bit my disk space and now I have about 3 GB free space and build started working.

@lham
Copy link

lham commented Nov 21, 2019

Just wanted to add that I also get an error [object Object] exit code 1, in my case when it's trying to sign a specific file, when using electron-builder 22.1.0.

My workaround was to downgrade to electron-builder 20.44.4 (as mentioned above) which allowed me to get a proper log output to investigate the issue. In my case I had misspelled the name of a directory in my customInstall macro in a .nsh file. I then upgraded to 22.1.0 again and it worked like a charm.

So I guess my point is, the error logging seems broken in 22.1.0

@24thsaint
Copy link

24thsaint commented Jan 3, 2020

Encountered this issue using electron-builder 21.2.0, error message was only [Object object].

image

Downgraded to 20.44.4 and the actual error was this^. I'm now able to make things work again.

@4ian
Copy link

4ian commented Jan 15, 2020

Similar issue with version 22.2.0 for https://github.com/4ian/GDevelop

Here are the logs in the hope it's helpful. I compiled with --win --linux tar.gz as arguments.
Downgrading to 20.44.4 fixes the issue (the build is successful without any error message). I've not yet tried intermediate versions.

  • electron-builder  version=22.2.0 os=17.7.0
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  dependencies=fsevents@1.2.4 platform=linux arch=x64
  • packaging       platform=linux arch=x64 electron=3.0.9 appOutDir=dist/linux-unpacked
  • building        target=tar.gz arch=x64 file=dist/gdevelop-5.0.0-beta88.tar.gz
  • rebuilding native dependencies  dependencies=fsevents@1.2.4 platform=win32 arch=x64
  • packaging       platform=win32 arch=x64 electron=3.0.9 appOutDir=dist/win-unpacked
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.5.0/winCodeSign-2.5.0.7z size=5.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.5.0/winCodeSign-2.5.0.7z duration=3.855s
  • building        target=nsis file=dist/GDevelop 5 Setup 5.0.0-beta88.exe archs=x64 oneClick=true perMachine=false
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.4.1/nsis-3.0.4.1.7z size=1.3 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.4.1/nsis-3.0.4.1.7z duration=3.073s
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.4.1/nsis-resources-3.4.1.7z size=731 kB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.4.1/nsis-resources-3.4.1.7z duration=4.229s
  ⨯ [object Object]

Happy to provide other informations or open a new issue if needed.

@hovancik
Copy link

Version ^22.2.0 is failing for me on AppVeyor where I am building for Windows.

The same version works fine on TravisCI where I am building for Linux and MacOS.

Downgrading to 20.44.4 works fine everywhere.

hovancik added a commit to hovancik/stretchly that referenced this issue Jan 16, 2020
* Release v0.21.1

* Downgrade electron-builder + update deps

electron-userland/electron-builder#4045 (comment)
@stale
Copy link

stale bot commented Mar 16, 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 Mar 16, 2020
@stale stale bot closed this as completed Mar 23, 2020
@lvbeck
Copy link

lvbeck commented May 4, 2020

@hovancik I don't known why the issue is closed but I still get same error with both electron-builder version 20.44.4 and 21.2.0:

uninstaller is not signed by electron-builder reason=custom NSIS script is used
⨯ [object Object]

version 20.44.4 does provide more information but failed to generate the uninstaller, either.

here is my config:

"nsis": {
  "warningsAsErrors": false,
  "shortcutName": "My App 6.0",
  "oneClick": false,
  "perMachine": false,
  "allowElevation": true,
  "allowToChangeInstallationDirectory": true,
  "createDesktopShortcut": true,
  "script": "build/installer.nsi",
  "license": "license.txt"
},

I have to use my custom "installer.nsi" because I want to override some macro in "multiUser.nsh", the only difference between my "installer.nsi" and default "installer.nsi" is:

#!include "multiUser.nsh"
!include "multiUser_custom.nsh"

I am not sure when this issue will be fixed.

@hovancik
Copy link

hovancik commented May 5, 2020

@lvbeck try latest version, I am not having this issue anymore

@lvbeck
Copy link

lvbeck commented May 5, 2020

@hovancik I upgraded to the latest 22.6.0, now another error occurred:

\node_modules\electron-builder\node_modules\fs-extra\lib\mkdirs\make-dir.js:86
      } catch {
              ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (\node_modules\electron-builder\node_modules\fs-extra\lib\mkdirs\index.js:3:44)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! esther@6.0.0 build: `node .electron-vue/build.js && electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the esther@6.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     \AppData\Roaming\npm-cache\_logs\2020-05-05T10_16_33_677Z-debug.log

@alphonsoTheGreat
Copy link

alphonsoTheGreat commented Jun 16, 2020

@lvbeck did you found the solution to your issue?
im having the same error while running electron-builder
/node_modules/electron-builder/node_modules/fs-extra/lib/mkdirs/make-dir.js:85 } catch { ^ SyntaxError: Unexpected token {

@lvbeck
Copy link

lvbeck commented Jun 17, 2020

@alphonsoTheGreat still not, I will test the next release later.

@talhaanees
Copy link

I'm on version 22.7.0 and have the same issue.
node_modules/electron-builder/node_modules/fs-extra/lib/mkdirs/make-dir.js:85 } catch { ^ SyntaxError: Unexpected token {
@lvbeck Can I know which version works for you so I can downgrade to that?

@lvbeck
Copy link

lvbeck commented Jul 9, 2020

@talhaanees if you don't have custom NSIS script "script": "build/installer.nsi" in the nsis section, try version 20.44.4, this works only with "include": "build/installer.nsh".

for me, I have to override the default installer.nsi completely, there is no working solution.

@talhaanees
Copy link

So, I did some playing around and eventually it did work for me with the latest version (22.7.0).
My code was in an external SSD. I copied it all to a local drive cleaned install everything (remove node_modules and package-lock) and it works. No object issues, no make-dir issue.

Still doesn't work with this version in Ext SSD. But it works with 20.44.4 in both cases.

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

No branches or pull requests