Typecheck fail: Property 'useNuxtImage' does not exist on type
Environment
- Operating System: Windows_NT
- Node Version: v20.9.0
- Nuxt Version: 3.12.4
- CLI Version: 3.12.0
- Nitro Version: 2.9.7
- Package Manager: [email protected]
- Builder: -
- User Config: modules, debug, devtools, future, routeRules, vue, imports, content, shadcn, css, colorMode, app, pwa, features, eslint, compatibilityDate
- Runtime Modules: @vueuse/[email protected], @unocss/[email protected], @pinia/[email protected], @pinia-plugin-persistedstate/[email protected], @nuxtjs/[email protected], @vite-pwa/[email protected], @nuxt/[email protected], ./modules/shadcn, @nuxt/[email protected]
- Build Modules: -
Reproduction
"@nuxt/content": "2.13.2"
Describe the bug
When I perform pnpm typecheck (vue-tsc --noEmit), the following error occurs:
node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProseImg.vue:15:52 - error TS2339: Property 'useNuxtImage' does not exist on type '{ components: { prose: boolean; map: { p: string; a: string; blockquote: string; "code-inline": string; code: string; em: string; h1: string; h2: string; h3: string; h4: string; h5: string; h6: string; hr: string; ... 10 more ...; tr: string; }; }; headings: { ...; }; }'.
15 const imgComponent = useRuntimeConfig().public.mdc.useNuxtImage ? resolveComponent('NuxtImg') : 'img'
However, I have not used @nuxt/image, and there is no image component in the code. My tsconfig.json is as follows:
{
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"skipLibCheck": true
},
"exclude": ["node_modules"]
}
And I have tried both TypeScript versions 5.4.5 and 5.5.2, but the error still occurs. How should I fix it?
Additional context
No response
Logs
No response
Hi. I've had the same issue. Installing Nuxt Image fixed it for me.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.