-
-
Notifications
You must be signed in to change notification settings - Fork 704
Open
Labels
v2Relevant for @nuxt/content v2Relevant for @nuxt/content v2
Description
Environment
- Operating System: Darwin
- Node Version: v22.14.0
- Nuxt Version: 4.0.0
- CLI Version: 3.26.2
- Nitro Version: 2.12.0
- Package Manager: [email protected]
- Builder: -
- User Config: compatibilityDate, devtools, modules, content
- Runtime Modules: @nuxt/[email protected]
- Build Modules: -
Version
v3.6.3
Reproduction
https://github.com/Jordan-Ellis/nuxt-content-restart-bug-reproduction/tree/master
- Create a new nuxt project with
bunx nuxi init
, and install nuxt content - Set watch enabled to false
- Make any change to the nuxt config while the server is running and it will crash.
content: {
watch: {
enabled: false,
}
}
Description
When using nuxt 4 and nuxt content, the server crashes when making a change to the nuxt config file with this error:
Cannot restart nuxt: Cannot read properties of undefined (reading 'server')
nuxt.hook("close", async () => {
await websocket?.close();
await listener.server.close(); // node_modules/@nuxt/content/dist/module.mjs:1683
});
I have the watch.enabled option disabled for nuxt content. So at first glance it seems like the code isn't accounting for the web socket server to not exist.
Additional context
No response
Logs
Metadata
Metadata
Assignees
Labels
v2Relevant for @nuxt/content v2Relevant for @nuxt/content v2