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

Icons are blank in an electron app on Windows #10

Open
jagthedrummer opened this issue Mar 25, 2024 · 2 comments · May be fixed by #11
Open

Icons are blank in an electron app on Windows #10

jagthedrummer opened this issue Mar 25, 2024 · 2 comments · May be fixed by #11

Comments

@jagthedrummer
Copy link

I have an ember-electron app that's using ember-heroicons. In most environments everything works exactly as expected. But on Windows when running the electron app the icons seem to be missing. There are wrapper <svg></svg> tags that show up where the icon should be, but there are no <path> elements inside of it. If I access the web version of the app from windows the icons work as expected. And the icons work inside the electron app on other, non-Windows platforms.

This sounds very similar to #5, but I suspect that it's a different thing. I've tried adding heroicons directly to package.json and that doesn't seem to make a difference. (heroicons was already in my yarn.lock as a dependency of ember-heroicons.)

I've verified (on Windows) that node_modules/heroicons contains the same things that it does on other platforms.

I'm not sure how to debug this any further. Any suggestions for fixes or additional debugging steps would be greatly appreciated.

@jagthedrummer
Copy link
Author

In trying to debug this further I inspected electron-app/ember-dist/assets/vendor-xxx.js on both Windows and Mac.

On Mac the file contains a bit like this:

define("ember-heroicons/utils/heroicons",["exports"],function(_exports){"use strict";Object.defineProperty(_exports,"__esModule",{value:true});_exports.ICONS=_exports.DEFAULT_TYPE=void 0;0;//eaimeta@70e063a35619d71feaimeta@70e063a35619d71f
const DEFAULT_TYPE=_exports.DEFAULT_TYPE='outline';const ICONS=_exports.ICONS=[{"name":"x-mark",...}];});

The ICONS array (on Mac) is huge and contains lots of data about all of the icons.

On Windows that bit of the file contains a completely empty ICONS array:

define("ember-heroicons/utils/heroicons",["exports"],function(_exports){"use strict";Object.defineProperty(_exports,"__esModule",{value:true});_exports.ICONS=_exports.DEFAULT_TYPE=void 0;0;//eaimeta@70e063a35619d71feaimeta@70e063a35619d71f
const DEFAULT_TYPE=_exports.DEFAULT_TYPE='outline';const ICONS=_exports.ICONS=[];});

@jagthedrummer
Copy link
Author

And it just occurred to me to see if ember s on Windows does the same thing as ember electron and it does. After running ember s on Windows I looked in dist/assets/vendor-xxx.js and it's showing the same thing as electron-app/ember-dist/assets/vendor-xxx.js. They both contain an empty ICONS array.

I'm guessing that this line might not be finding all the files that it expects to find even though they're there:

const icons = globSync(path.join(heroIconsPath, '**', '*.svg'))

@jagthedrummer jagthedrummer linked a pull request Mar 25, 2024 that will close this issue
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.

1 participant