Hi guys can you help me with this error H3Error: ENOENT: no such file or
I started to get this error all of a sudden.
[request error] [unhandled] [GET] https://dev.revlabs.io/_nuxt/Dv0bs_qm.js
H3Error: ENOENT: no such file or directory,dev open '/var/www/cim-ui/.output/server/chunks/nitro/chunks/public/_nuxt/Dv0bs_qm.js'
at open (node:internal/fs/promises:639:25)
... 2 lines matching cause stack trace ...
at Server.toNodeHandle (file:///var/www/cim-ui/.output/server/chunks/nitro/nitro.mjs:2662:7) {
statusCode: 500,
fatal: false,
unhandled: true,
statusMessage: undefined,
data: undefined,
[cause]: Error: ENOENT: no such file or directory, open '/var/www/cim-ui/.output/server/chunks/nitro/chunks/public/_nuxt/Dv0bs_qm.js'
at open (node:internal/fs/promises:639:25)
at Object.readFile (node:internal/fs/promises:1242:14)
at Object.handler (file:///var/www/cim-ui/.output/server/chunks/nitro/nitro.mjs:2391:19)
at Server.toNodeHandle (file:///var/www/cim-ui/.output/server/chunks/nitro/nitro.mjs:2662:7) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/var/www/cim-ui/.output/server/chunks/nitro/chunks/public/_nuxt/Dv0bs_qm.js'
}
}
3 Replies
Hi @oneiros6461. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The error you're seeing,
If the
If you are using a CDN like Cloudflare, cached references to old chunk files can cause 404/ENOENT errors after a new deployment, because the client may request a file that no longer exists on the server. Several users have reported that purging the CDN cache after each deployment resolves this issue. Some also recommend programmatically purging everything inside the Nuxt assets directory after deployment to avoid such problems Github Issue: Failed to fetch dynamically imported module, Github Issue: Multiple Nuxt Chunk Files Returning 503 Errors. 3. Deployment/Build Process Issues:
If you are using Docker or a similar deployment process, ensure that the
H3Error: ENOENT: no such file or directory, specifically for a missing JS chunk like /_nuxt/Dv0bs_qm.js, is commonly related to issues with missing or outdated build assets in your Nuxt .output directory. This can happen for several reasons:
1. Stale or Missing Build Artifacts:If the
.output directory does not contain the expected files, the server will throw an ENOENT error when trying to serve them. This can occur if the build did not complete successfully, or if files were deleted or not copied correctly. It's important to ensure that you run nuxt build and that the .output directory is fully populated before deploying. You should not manually modify files in .output, as it is regenerated on each build and is meant for deployment only Nuxt 3.x Directory Structure - .output.
2. Cache Issues with CDN/Proxy (e.g., Cloudflare):If you are using a CDN like Cloudflare, cached references to old chunk files can cause 404/ENOENT errors after a new deployment, because the client may request a file that no longer exists on the server. Several users have reported that purging the CDN cache after each deployment resolves this issue. Some also recommend programmatically purging everything inside the Nuxt assets directory after deployment to avoid such problems Github Issue: Failed to fetch dynamically imported module, Github Issue: Multiple Nuxt Chunk Files Returning 503 Errors. 3. Deployment/Build Process Issues:
If you are using Docker or a similar deployment process, ensure that the
.output directory is correctly copied from the build stage to the production stage, and that no volume mounts are overwriting it at runtime. Mounting your project directory as a volume in Docker can overwrite the .output directory with an empty one, causing these errors Stack Overflow: Nuxt3 with Docker.
Recommended Steps:
- Rebuild your Nuxt project with nuxt build to ensure all assets are generated.
- Deploy the fresh .output directory to your server.
- If using a CDN (like Cloudflare), purge the cache after deployment to remove references to old chunk files.
- Double-check your deployment process (especially with Docker) to ensure .output is not being overwritten or left empty.
If the problem persists after these steps, consider checking for any custom server or CDN configuration that might interfere with asset serving.
Let me know if you need more specific troubleshooting based on your deployment setup!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1042987933449342977> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Still no change, I'm not using docker, I'm building and deploying it using cicd pipeline. And it's working in local as well
And this is just one of the errors, I'm getting tons more
No worries i figured it out, the build stage of the pipeline was running a different node version. Once i corrected it it was working fine