nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.07k stars 623 forks source link

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

Open insub opened 1 month ago

insub commented 1 month ago

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/@nuxtjs+mdc@0.8.3_magicast@0.3.4_rollup@4.18.0/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

haashemi commented 1 month ago

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