NuxtN
Nuxt7mo ago
4 replies
Samuelreichoer

hmr not working in nuxt content v3

I just finished migrating nuxt content v2 to v3 and my hrm in all content pages does not work anymore. I have this content.config.ts file

import { defineCollection, defineContentConfig, z } from '@nuxt/content'

export default defineContentConfig({
  collections: {
    blog: defineCollection({
      source: '1.blogs/*.md',
      type: 'page',
      schema: z.object({
        tags: z.array(z.string()),
        imgPath: z.string(),
        datePublished: z.date(),
        readingTime: z.string(),
      })
    }),
    docs: defineCollection({
      source: '2.libraries/**/*.md',
      type: 'page',
      schema: z.object({
        badge:  z.string(),
        icon:  z.string(),
        type:  z.string(),
      })
    })
  }
})


This is the content folder tree
.
─ 1.blogs
─ craft-coolify.md
─ craft-preview-hr-nuxt.md
─ graphql-craftcms-sucks.md
─ 2.libraries
─ 1.craft-query-api
─ 2.craft-loanwords
─ 3.craft-quick-edit
─ 4.nuxt-craftcms
─ 5.js-craftcms-api
─ 6.vue-craftcms
─ 7.query-api-react

This is my nuxt config
export default defineNuxtConfig({
devtools: { enabled: true },
future: {
compatibilityVersion: 4,
},

modules: ['@nuxt/ui', '@nuxt/content', '@nuxtjs/seo', 'nuxt-llms'],
content: {
build: {
markdown: {
toc: {
depth: 2,
},
highlight: {
langs: ['js','jsx','json','ts','tsx','vue','css','html','bash','md','mdc','yaml', 'php', 'dockerfile'],
theme: {
default: 'github-dark',
dark: 'github-dark',
light: 'github-light',
}
}
},
}
},
compatibilityDate: '2024-11-01',
})
Was this page helpful?