icon
icon copied to clipboard
Locally installed `@iconify-json/*` packages result in 'needs an import attribute of type "json"' error
After installing an @iconify-json/* package (@iconify-json/mdi in my scenario), the following error gets spit out when the /api/_nuxt_icon/:collection endpoint is called
It seems to be caused by the dynamic import missing the json import attribute on line 120 of module.ts https://github.com/nuxt/icon/blob/85a0e7b940725561f35656d75a99179f88cecef8/src/module.ts#L120
Adding { with: { type: 'json' } } as a second parameter resolves the error for me:
import('@iconify-json/${collection}/icons.json', { with: { type: 'json' } }).then(m => m.default)`