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

Error: buffer is not ico #349

Closed
daviseford opened this issue Apr 21, 2016 · 8 comments · May be fixed by qcif/data-curator#563
Closed

Error: buffer is not ico #349

daviseford opened this issue Apr 21, 2016 · 8 comments · May be fixed by qcif/data-curator#563

Comments

@daviseford
Copy link

Hey there, when I try to build the win32 version of my app, I receive this error

Error: buffer is not ico
at parseIco (/Users/loaner/opat-presentation/native/node_modules/electron-builder/src/winPackager.ts:202:11)
at /Users/loaner/opat-presentation/native/node_modules/electron-builder/src/winPackager.ts:185:25
at [object Generator].next (native)
at /Users/loaner/opat-presentation/native/node_modules/electron-builder/node_modules/fs-extra-p/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:43:10
at /Users/loaner/opat-presentation/native/node_modules/electron-builder/node_modules/read-package-json/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:82:15)
From previous event:
at tsAwaiter (/Users/loaner/opat-presentation/native/node_modules/electron-builder/src/awaiter.ts:10:51)
at Object.build (/Users/loaner/opat-presentation/native/node_modules/electron-builder/src/builder.ts:30:59)
at Object. (/Users/loaner/opat-presentation/native/node_modules/electron-builder/src/build-cli.ts:41:2)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3

The Mac and Linux versions of my project build just fine. At first I thought this error might be related to my "iconUrl", but haven't had any luck switching it. Has anyone else run into this issue?

@develar
Copy link
Member

develar commented Apr 21, 2016

Please check that your build/icon.ico is a valid ICO file.

@daviseford
Copy link
Author

D'oh! Thanks!

@develar develar reopened this Apr 21, 2016
@develar
Copy link
Member

develar commented Apr 21, 2016

Reopened — the error message is unclear and must be fixed.

@develar
Copy link
Member

develar commented Apr 21, 2016

@daviseford Please clarify — ico file was invalid (why?) or didn't exist?

@daviseford
Copy link
Author

I copied the /build directory from https://github.com/develar/onshape-desktop-shell/. Apparently the .ico files in that directory were not valid. The file did exist, but even my Mac couldn't open them - files must have been corrupted or something. After I replaced icon.ico with a new, valid icon, the build worked.

@develar
Copy link
Member

develar commented Apr 21, 2016

@daviseford onshape-desktop-shell uses GIT LFS to store binary files. If you clone repo without installed GIT LFS, you get just text pointers. Thanks for clarification.

@demetris-manikas
Copy link
Contributor

@develar
This https://www.npmjs.com/package/icojs could be used to check ico .
and this https://www.npmjs.com/package/image-type could be used to check the rest of the image files

@develar
Copy link
Member

develar commented Apr 25, 2016

@demetris-manikas We already check icohttps://github.com/electron-userland/electron-builder/blob/master/src/winPackager.ts#L225 (yes, I saw icojs but ico is very easy to check/read).

update: this issue is open because instead of unclear error message we should check that buffer is a string and throw error like "It seems it is a GIT LFS pointer, please check that GIT LFS is installed"

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

Successfully merging a pull request may close this issue.

3 participants