content icon indicating copy to clipboard operation
content copied to clipboard

Typecheck fail: Property 'useNuxtImage' does not exist on type

Open insub opened this issue 1 year ago • 2 comments

Environment



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

insub avatar Jul 31 '24 03:07 insub

Hi. I've had the same issue. Installing Nuxt Image fixed it for me.

haashemi avatar Aug 10 '24 16:08 haashemi

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.

github-actions[bot] avatar Oct 10 '24 02:10 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Nov 10 '24 02:11 github-actions[bot]