tzellman / ember-heroicons

Heroicons for Ember.js
MIT License
7 stars 4 forks source link

Icons are blank in an electron app on Windows #10

Open jagthedrummer opened 7 months ago

jagthedrummer commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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:

https://github.com/tzellman/ember-heroicons/blob/4e174786beedd42dbe0b4fac5c90dc80f0ee3a1f/index.js#L55