Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/runtime/components/nuxt-icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ async function getIcon () {
as: 'raw',
eager: false
})
const rawIcon = await iconsImport[`/assets/icons/${props.name}.svg`]()
const rawIconImport = iconsImport[`/assets/icons/${props.name}.svg`]
if (!rawIconImport) {
console.error(
`[nuxt-icons] Icon '${props.name}' doesn't exist in 'assets/icons'`
)
return
}
const rawIcon = await rawIconImport()
if (rawIcon.includes('stroke')) { hasStroke = true }
icon.value = rawIcon
} catch {
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "./playground/.nuxt/tsconfig.json"
"extends": "./playground/.nuxt/tsconfig.json",
"compilerOptions": {
"noUncheckedIndexedAccess": true
}
}