feathericons / elm-feather

Feather icons for elm
http://package.elm-lang.org/packages/1602/elm-feather/latest
BSD 3-Clause "New" or "Revised" License
77 stars 4 forks source link

Error with 0.19 #9

Closed David-Factor closed 5 years ago

David-Factor commented 6 years ago

Thanks for the great library. I really love the API!

Just installed this in a 0.19 project. I get the following error in the console: SyntaxError: identifier starts immediately after numeric literal

Digging a little deeper it seems the offending line in the compiled js is:

var 1602$elm_feather$FeatherIcons$Icon = function (a) {
    return {$: 'Icon', a: a};
};

Looks like 0.19 assigns your name as a variable. Given that your name is a numeric literal, the js borks. For details about why this is illegal in js, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Identifier_after_number

Not sure what the solution is other than republishing this package under another namespace?

Cheers, Dave

1602 commented 6 years ago

Hey @David-Factor, we're waiting for bugfix in compiler for elm 0.19: https://github.com/elm/compiler/issues/1763

I also thought about publishing under a safe name, but decided that it would be confusing for users and not very responsible as elm user, because this is just a bug after all, and it may affect not just me or this particular use case, so it is better to have it fixed. So I decided to be patient and wait for new version of compiler (you could imagine, all my work on 0.19 is currently blocked because of this, lol).

ryan-senn commented 6 years ago

If anyone is looking for a workaround, this is what I'm doing at the moment:

And it should be working. Just remember to check back every now and then and undo all of the above!

1602 commented 5 years ago

elm-feather has now moved to feathericons GH org and elm package published under a new name: feathericons/elm-feather