Custom collections aren't recognised
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nuxt, typescript
Research direction
Start with src/collection-names.ts and the collectionNames usage in src/collections.ts at the linked lines, then compare the working serverBundle.collections configuration in nuxt.config.ts with the failing SSR-disabled setup. Done means a custom installed collection such as “as” is recognised in the reported configuration, with any missing-collection behavior clarified.
Written by the indexing model from the issue text.
Description
Hi, hope you're all doing well!
I ran into an issue using @nuxt/ui which now uses @nuxt/icon under the hood (used to work when icon collection names could be specified as nuxt/ui module args even tho i had to add a ts-ignore as it wasn't referenced in the enum type), I am using a custom iconify collection i built which goes by
"@iconify-json/as": "npm:@my-org-name/my-icon-collection@^0.0.2",
in my package.json which isn't referenced in
https://github.com/nuxt/icon/blob/main/src/collection-names.ts
thus making it uncompatible with @nuxt/icon.
I think the issue comes from the usage of collectionNames there (as it seems we only values are only read if they are part of the underlying array):
https://github.com/nuxt/icon/blob/cc14fe49b19fce023ba6f049984317492043c9ab/src/collections.ts#L72-L73
Would it be possible further expand the compatibility to include custom collections? (and eventually check if these are installed print an error on the logger if it isn't the case)
NOTE: It seems to work when using this configuration (note SSR isn't set to false which is a constraint I have)
icon: {
serverBundle: {
collections: [
'as'
]
}
}
but it the specific project is using this piece of config
[...]
ssr: false, // SSR forced to false
icon: {
provider: 'server', // Tried with and without this
serverBundle: {
collections: [
'as'
]
}
}
Sorry if it is a bit long, I tried my best to keep it pleasant to read though. Thank you in advance! :)
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 97
- Avg merge
- 9d 2h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nuxt/icon
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Similar issues
-
bug hacktoberfest help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
libredb/libredb-studio#1941 ·
Maintainers usually reply within 1 day
-
chore other
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
alastair-smith/card-games#308 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
paperclipai/paperclip#17379 ·
Maintainers usually reply within 1 day
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Anime Quote 626 (good-first-issue)Opencommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
lingdojo/kana-dojo#33040 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
bug mobile ui
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day