Describe the bug
I found a bug about type error.
vue-tsc error at line 27 of nuxt-icon.vue, while activated noUncheckedIndexedAccess in tsconfig.
To Reproduce
It occurs vue-tsc error on building nuxt-icons.
export default defineNuxtConfig({
ssr: false,
typescript: {
typeCheck: true,
},
app: {
head: {
charset: 'utf-8',
title: '',
},
},
modules: ['nuxt-icons'],
vue: {
compilerOptions: {
whitespace: 'preserve',
},
},
telemetry: false,
devtools: {
enabled: true
},
})
{
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"noUncheckedIndexedAccess": true
}
}
{
"name": "test",
"version": "1.0.0",
"description": "",
"author": "",
"scripts": {
"build": "nuxt build",
"dev": "rm -rf /tmp/nitro && HOST=0.0.0.0 PORT=8080 nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
},
"dependencies": {
"nuxt": "^3.8.2",
"nuxt-icons": "^3.2.1",
"sass": "^1.69.5",
"vue": "^3.3.10",
},
"devDependencies": {
"@nuxt/devtools": "latest",
"typescript": "^5.4.3",
"vue-tsc": "^1.8.27"
},
"optionalDependencies": {
"@rollup/rollup-linux-arm64-gnu": "^4.9.1",
"@rollup/rollup-linux-x64-gnu": "^4.9.1"
}
}
Expected behavior
// nuxt-icons/dist/runtime 27 line
const rawIcon = await iconsImport[`/assets/icons/${props.name}.svg`]()
Maybe, It needs to fix.
const iconsImportFunc = iconsImport[`/assets/icons/${props.name}.svg`]
if (iconsImportFunc === undefined) {
return
}
const rawIcon = await iconsImportFunc()
Screenshots

Desktop (please complete the following information):
- OS: Apple M2 13.5
- Browser: Chrome
- Version: 122.0.6261.112(Official Build) (arm64)
Describe the bug
I found a bug about type error.
vue-tsc error at line 27 of nuxt-icon.vue, while activated noUncheckedIndexedAccess in tsconfig.
To Reproduce
It occurs vue-tsc error on building nuxt-icons.
{ "extends": "./.nuxt/tsconfig.json", "compilerOptions": { "noUncheckedIndexedAccess": true } }{ "name": "test", "version": "1.0.0", "description": "", "author": "", "scripts": { "build": "nuxt build", "dev": "rm -rf /tmp/nitro && HOST=0.0.0.0 PORT=8080 nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare", }, "dependencies": { "nuxt": "^3.8.2", "nuxt-icons": "^3.2.1", "sass": "^1.69.5", "vue": "^3.3.10", }, "devDependencies": { "@nuxt/devtools": "latest", "typescript": "^5.4.3", "vue-tsc": "^1.8.27" }, "optionalDependencies": { "@rollup/rollup-linux-arm64-gnu": "^4.9.1", "@rollup/rollup-linux-x64-gnu": "^4.9.1" } }Expected behavior
Maybe, It needs to fix.
Screenshots

Desktop (please complete the following information):