Environment
- Nuxt version:
4.4.7
- Nitro preset:
node-server
- Package manager:
[email protected]
- Runtime: Node
v22.22.3
- Deployment: built on server, run with
node .output/server/index.mjs via PM2
Describe the bug
After upgrading to Nuxt 4.4.7, the production server build completes successfully, but the deployed app returns a runtime 500 on SSR requests.
Runtime error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/stir-project/htdocs/releases/20260602185622/.output/server/node_modules/unhead/dist/server.mjs' imported from /home/stir-project/htdocs/releases/20260602185622/.output/server/chunks/routes/renderer.mjs
The generated renderer imports unhead/server:
import { createHead, propsToString, renderSSRHead } from 'unhead/server'
But the packaged server output contains an incomplete [email protected] package:
.output/server/node_modules/unhead -> .nitro/[email protected]
And inside the packaged dist directory only these files are present:
.output/server/node_modules/unhead/dist/scripts.mjs
.output/server/node_modules/unhead/dist/shared/
Missing files include:
.output/server/node_modules/unhead/dist/server.mjs
.output/server/node_modules/unhead/dist/index.mjs
.output/server/node_modules/unhead/dist/plugins.mjs
.output/server/node_modules/unhead/dist/utils.mjs
However, .output/server/node_modules/unhead/package.json still exposes:
{
"./server": {
"types": "./dist/server.d.ts",
"default": "./dist/server.mjs"
}
}
So Node resolves unhead/server to a file that does not exist in the generated server output.
Reproduction details
We have not yet reduced this to a minimal public reproduction, but this is consistently reproducible in our production deploy after the Nuxt 4.4.7 update.
The build itself reports success:
✔ Nuxt Nitro server built
✨ Build complete!
But runtime SSR requests fail with the missing module error above.
Workaround
Pinning/overriding Nuxt back to 4.4.6 fixes the generated .output for us.
With Nuxt 4.4.6:
output unhead 2.1.15
output server.mjs OK
The generated output includes:
.output/server/node_modules/unhead/dist/server.mjs
.output/server/node_modules/unhead/dist/index.mjs
.output/server/node_modules/unhead/dist/plugins.mjs
.output/server/node_modules/unhead/dist/utils.mjs
So our current workaround is to pin Nuxt to 4.4.6 until this is resolved.
Expected behavior
The node-server production output should include all files referenced by package exports used by the generated renderer, especially unhead/server -> dist/server.mjs.
Actual behavior
Nuxt 4.4.7 generates a server output that references unhead/server, packages [email protected], but only includes a partial dist directory. This causes runtime SSR requests to fail with ERR_MODULE_NOT_FOUND.
Environment
4.4.7node-server[email protected]v22.22.3node .output/server/index.mjsvia PM2Describe the bug
After upgrading to Nuxt
4.4.7, the production server build completes successfully, but the deployed app returns a runtime 500 on SSR requests.Runtime error:
The generated renderer imports
unhead/server:But the packaged server output contains an incomplete
[email protected]package:And inside the packaged
distdirectory only these files are present:Missing files include:
However,
.output/server/node_modules/unhead/package.jsonstill exposes:{ "./server": { "types": "./dist/server.d.ts", "default": "./dist/server.mjs" } }So Node resolves
unhead/serverto a file that does not exist in the generated server output.Reproduction details
We have not yet reduced this to a minimal public reproduction, but this is consistently reproducible in our production deploy after the Nuxt
4.4.7update.The build itself reports success:
But runtime SSR requests fail with the missing module error above.
Workaround
Pinning/overriding Nuxt back to
4.4.6fixes the generated.outputfor us.With Nuxt
4.4.6:The generated output includes:
So our current workaround is to pin Nuxt to
4.4.6until this is resolved.Expected behavior
The
node-serverproduction output should include all files referenced by package exports used by the generated renderer, especiallyunhead/server -> dist/server.mjs.Actual behavior
Nuxt
4.4.7generates a server output that referencesunhead/server, packages[email protected], but only includes a partialdistdirectory. This causes runtime SSR requests to fail withERR_MODULE_NOT_FOUND.