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

Not imports ux-icons #257

Open
DanieleRosada opened this issue Apr 23, 2020 · 2 comments
Open

Not imports ux-icons #257

DanieleRosada opened this issue Apr 23, 2020 · 2 comments

Comments

@DanieleRosada
Copy link

import * as icons from '@aurelia-ux/icons/sets/full-array.min.json';
aurelia.use.plugin(PLATFORM.moduleName('@aurelia-ux/icons'), { icons })

This is my main.ts.
I ran the instructions found in
https://aurelia.io/blog/2020/03/02/aurelia-release-notes-march-2020/

Could anyone help me?
Do I need to import anything into webpack?

@ben-girardet
Copy link
Contributor

Hi @DanieleRosada thanks for reaching here.

What you did is right. Are you using typescript ? Did you also follow the instruction regarding the tsconfig.json on the blog ?

Basically it says:

Importing JSON

Note for TypeScript users: Make sure that your tsconfig.json is set to allow importing JSON files. This can be achieved by setting "resolveJsonModule": true in the compilerOptions section.

If this doesn't solve your problem, could you give us more details regarding your situation ?

  • are you using typescript ?
  • any error or warning in the console ?

Alternative solution:

I have faced a situation once where even with the resolveJsonModule: true in tsconfig.json the icons would not load properly. I realized that even though the module would import, it would not be imported as expected. To fix this I did this in the main.ts:

.plugin(PLATFORM.moduleName('@aurelia-ux/icons'), {icons: (icons as any).default})

If this is also your case please let me know as I would like to investigate a little more and see if we can find a better solution.

@DanieleRosada
Copy link
Author

.plugin(PLATFORM.moduleName('@aurelia-ux/icons'), {icons: (icons as any).default})

With this it works, thank you!
I use typescript and I had no errors and no warnings,
except this warning that's left in the visual studio code console:

WARNING in @aurelia-ux/core
Multiple versions of @aurelia-ux/core found:
0.18.1 .//@aurelia-ux\core
0.19.0 ./
/@aurelia-ux\icons/~/@aurelia-ux\core

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

No branches or pull requests

2 participants