Custom content collection do not hot-reload
Environment
- Operating System: Darwin
- Node Version: v23.7.0
- Nuxt Version: 4.0.3
- CLI Version: 3.27.0
- Nitro Version: 2.12.4
- Package Manager: [email protected]
- Builder: -
- User Config: compatibilityDate, components, devtools, modules, css, ui, runtimeConfig, site, vite, colorMode, nitro, pwa, experimental
- Runtime Modules: @nuxt/[email protected], [email protected], @pinia/[email protected], @nuxt/[email protected], @vueuse/[email protected], @nuxt/[email protected], @vite-pwa/[email protected], @nuxt/[email protected], @nuxtjs/[email protected]
- Build Modules: -
Version
v3
Reproduction
Create an empty Nuxt content project, and create a new collection
doc: defineCollection({
type: 'page',
source: 'docs/install-short/**/*.md',
schema: z.object({
title: z.string(),
description: z.string(),
language: z.enum(['html', 'nuxt', 'react']),
icon: z.string().optional(),
enabled: z.boolean().optional(),
}),
}),
Description
Whenever a custom collection is used, the markdown hot-reload does not work anymore
The file change is detected (File docs/install-short/1.html.md changed on content collection ) but the dev server does not update, and need to be restarted to see the changes
Additional context
No response
Logs
A full upgrade to the new nuxt 4.0.3 Version fixed the described issue, which was introduced in my project, while updating packages. That's the reason why I wanted to upgrade to nuxt 4.0.3. I had some problems with other nuxt modules, but now, after the upgrade is fully completed (changing directory structure etc., like Upgrade Guide tells to), my last test before writing this comment, shows, that it now hot-reload changes to the markdown files.
------------------------------
- Operating System: Linux
- Node Version: v24.6.0
- Nuxt Version: 4.0.3
- CLI Version: 3.28.0
- Nitro Version: 2.12.4
- Package Manager: [email protected]
- Builder: -
- User Config: devtools, app, appConfig, compatibilityDate, debug, dev, sourcemap, ssr, routeRules, css, postcss, experimental, modules, hooks, site, sitemap, i18n, icon, ogImage, nitro, router, content
- Runtime Modules: @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @vueuse/[email protected], [email protected], [email protected], [email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxtjs/[email protected]
- Build Modules: -
------------------------------
A full upgrade to the new nuxt 4.0.3 Version fixed the described issue, which was introduced in my project, while updating packages. That's the reason why I wanted to upgrade to nuxt 4.0.3. I had some problems with other nuxt modules, but now, after the upgrade is fully completed (changing directory structure etc., like Upgrade Guide tells to), my last test before writing this comment, shows, that it now hot-reload changes to the markdown files.
------------------------------ - Operating System: Linux - Node Version: v24.6.0 - Nuxt Version: 4.0.3 - CLI Version: 3.28.0 - Nitro Version: 2.12.4 - Package Manager: [email protected] - Builder: - - User Config: devtools, app, appConfig, compatibilityDate, debug, dev, sourcemap, ssr, routeRules, css, postcss, experimental, modules, hooks, site, sitemap, i18n, icon, ogImage, nitro, router, content - Runtime Modules: @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @vueuse/[email protected], [email protected], [email protected], [email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxtjs/[email protected] - Build Modules: - ------------------------------
I already uses 4.0.3 :/
@jeannen Could you prove a reproduction project? A simple git repo or online on StackBlitz?
I can give you access to one of my repo if needed (but it's really just a new Nuxt Content project with a few posts tho, and got the same issue on all my other Nuxt Content projects)
@jeannen Could you prove a reproduction project? A simple git repo or online on StackBlitz?
Same here
I can't remember what exactly fixed it for me, but maybe one of these could help:
export default defineNuxtConfig({
hooks: {
'vite:configResolved'(config) {
// Enforce again on the fully resolved Vite config (final safeguard)
if (config.server) {
const srv = config.server as unknown as { watch?: Record<string, unknown> };
srv.watch = srv.watch || {};
(srv.watch as any).ignored = ['**/node_modules/**', '**/.git/**'];
}
}
}
})
or
export default defineNuxtConfig({
experimental: {
payloadExtraction: true,
watcher: 'chokidar'
},
})
------------------------------
- Operating System: Linux
- Node Version: v24.7.0
- Nuxt Version: 4.1.2
- CLI Version: 3.28.0
- Nitro Version: 2.12.6
- Package Manager: [email protected]
- Builder: -
- User Config: devtools, app, appConfig, compatibilityDate, debug, dev, sourcemap, ssr, routeRules, css, postcss, experimental, modules, schemaOrg, hooks, site, sitemap, components, i18n, icon, ogImage, runtimeConfig, nitro, router, content
- Runtime Modules: @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @vueuse/[email protected], [email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxtjs/[email protected]
- Build Modules: -
------------------------------
For me, it still works in (now) 4.1.2.
Hope this helps.
@Mastercuber neither option worked for me. Using npm with nuxt content v3.8.1 and nuxt v4.2.1. Only when I touch nuxt config while the local server is running does my one of my nuxt content pages refresh. Otherwise, I have to restart the server.
Still experiencing the issue
Using Nuxt 4.2.1, Nuxt Content 3.8.2, with bun 1.3.2 has seemed work for me so far. Whereas, old versions of Nuxt Content 3.8.1 with bun 1.3.1 did not.