In the previous version of @nuxt/content (1.x) with Nuxt v2 and @nuxt/img (v0), you used to be able to write this in your Markdown files:
content/example.md
<nuxt-img src="img/myImage.jpg"></nuxt-img>
In Nuxt v3 world, with the latest @nuxt/content (2.2.1) and @nuxt/image-edge (1.0.0-27769790.4b27db3), I am getting this error while running in development (yarn run dev):
[Vue warn]: Failed to resolve component: NuxtImg
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
Am I doing something wrong? Do I need to use the new MDC syntax? Is it not yet supported, or not supported when SSR is disabled (ssr: false)?
There's a few tickets I'm aware of/watching:
- @nuxt/image Checklist for Nuxt 3 support: https://github.com/nuxt/image/discussions/548
- @nuxt/image feat: support prerendering static images: https://github.com/nuxt/image/pull/614
- @nuxt/content Support for @nuxt/image (v1): https://github.com/nuxt/content/issues/624
Details
package.json
"@nuxt/content": "^2.2.1",
"@nuxt/image-edge": "^1.0.0-27769790.4b27db3",
"nuxt": "^3.0.0-rc.13"
NOTE: @nuxt/image-edge is the work-in-progress for the new @nuxt/image v1 module which will work with Nuxt 3. Mentioned here.
nuxt.config.ts
export default defineNuxtConfig({
ssr: false, // Use without SSR
components: false // Disabled auto-import components
})
moduleskey?export default defineNuxtConfig({ modules: [ '@nuxt/image-edge', ] })<nuxt-link></nuxt-link>in it... so it seems like the default Nuxt 3 components are not accessible from the @nuxt/content context yet?