Locally installed `@iconify-json/*` packages result in 'needs an import attribute of type "json"' error
Closed this issue · 0 comments
danjrwalsh commented
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
Line 120 in 85a0e7b
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)`