favicon-emoji icon indicating copy to clipboard operation
favicon-emoji copied to clipboard

TypeError: "value" argument is out of bounds

Open ItsNickBarry opened this issue 5 years ago • 4 comments

> favicon-emoji --emoji ✨
(node:11969) UnhandledPromiseRejectionWarning: TypeError: "value" argument is out of bounds
    at checkInt (buffer.js:1185:11)
    at Buffer.writeUInt8 (buffer.js:1233:5)
    at createDirectory (/home/nickbarry/.nvm/versions/node/v8.12.0/lib/node_modules/favicon-emoji/node_modules/to-ico/index.js:32:6)
    at Promise.all.then.data (/home/nickbarry/.nvm/versions/node/v8.12.0/lib/node_modules/favicon-emoji/node_modules/to-ico/index.js:98:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:11969) 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:11969) [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.

> node --version
v8.12.0

ItsNickBarry avatar Feb 28 '19 21:02 ItsNickBarry

A favicon.png is generated, regardless of whether the -d option is used.

ItsNickBarry avatar Feb 28 '19 22:02 ItsNickBarry

Hmm, yes. It seems like a bug, https://github.com/albinekb/favicon-emoji/blob/master/cli.js#L37 --png has a default of ./favicon.png So, here it writes the file: https://github.com/albinekb/favicon-emoji/blob/master/cli.js#L60

If you specify --png='' it should not happen

albinekb avatar Mar 01 '19 10:03 albinekb

The .png generation seems to work as expected, but no .ico is generated at all. However, it works when I specify the --minimum option.

It's not entirely clear what this option is meant to do. The usage text says this:

-m, --minimum create favicon with selected sizes (16x16, 32x32, 48x48)

But the .ico generated is 56x56.

ItsNickBarry avatar Mar 01 '19 23:03 ItsNickBarry

This is what minimum is supposed to do: const sizes = args['--minimum'] ? [16, 32, 48] : [16, 32, 48, 64, 128, 256] It was introduced here: https://github.com/albinekb/favicon-emoji/pull/12

albinekb avatar Mar 02 '19 13:03 albinekb