nuxt / content

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

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

Closed insub closed 2 weeks ago

insub commented 3 months 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 3 months ago

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

github-actions[bot] commented 1 month ago

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] commented 2 weeks ago

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