jaretburkett/electron-icon-maker

Promise Rejection on Mac Icon Generation

Closed this issue ยท 7 comments

Issue: When running icon maker on an image, a promise error is given when it starts to generate the Mac icons

OS: OSX 10.12.5
Electron-Icon-Maker: 0.0.3
Node.js: 7.7.2 & 8.1.3

running with:

$ electron-icon-maker -i assets/icon.png -o build/

NOTE: I did use the input and output flags as well, with the same results (thinking it was the process.args array)

It creates all of the png images without an issue, and then shoots this error out:

Icon generetor from PNG:
  src: /Users/dbrown/Development/hue/build/icons/png
  dir: /Users/dbrown/Development/hue/build/icons/mac
(node:77373) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2)
: Error: TypeError: Cannot read property '[object Array]' of undefined
(node:77373) 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.

btw, in this line "Icon generetor from PNG", do you mean generated?

Thanks for this module!

it appeared also in windows.

Exact same error here:

Icon generetor from PNG:
  src: /Users/s/Github/MND/build/icons/png
  dir: /Users/s/Github/MND/build/icons/mac
(node:31077) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: TypeError: Cannot read property '[object Array]' of undefined
(node:31077) 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.

Think thats an issue with icon-gen. There is an sizes options that used too have a default value. But this is never set when you require this module.

https://github.com/akabekobeko/npm-icon-gen/blob/master/src/lib/index.js#L23

so it crashes here.

https://github.com/akabekobeko/npm-icon-gen/blob/master/src/lib/icon-generator.js#L71

Of course this ended up being something stupid. Icon-gen 1.0.8 has breaking changes, so if you lock the version to 1.0.7 in the package.json, and reinstall, all will work as expected.

hmpf ๐Ÿ˜”

@herrmannplatz Adding the new size option would certainly be ideal, but it would definitely require a version update by the maintainer otherwise it would break for 1.0.7 users. ๐Ÿ˜ž

Thank you for your pull request @3desprit . Sorry it took me some time to merge it. I have not worked on this project in a while. It has been merged and I updated the NPM repo.