Hello All!
I have 5 Svelte projects deployed on Vercel and can’t figure this out. I couldn’t deploy my project so I created a vanilla Svelte/Sveltekit project with the vercel adaptor and it won’t deploy. I checked my projects that deploy and the svelte.config.js and package.json and everything else appear the same.
**Here’s the error I get on both projects. **
2025-08-28T12:13:43.236Z [error] Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/.svelte-kit/vercel-tmp/index.js' imported from /opt/rust/nodejs.js
at finalizeResolution (node:internal/modules/esm/resolve:287:11)
at moduleResolve (node:internal/modules/esm/resolve:956:10)
at moduleResolveWithNodePath (node:internal/modules/esm/resolve:1192:14)
at defaultResolve (node:internal/modules/esm/resolve:1235:79)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
at ModuleLoader.import (node:internal/modules/esm/loader:539:34)
at defaultImportModuleDynamicallyForScript (node:internal/modules/esm/utils:234:31) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///var/task/.svelte-kit/vercel-tmp/index.js'
}
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
Here’s my project summary:
The project builds successfully locally and generates all required files, including the missing /var/task/.svelte-kit/vercel-tmp/index.js. The error suggests a deployment-time issue where Vercel cannot locate the generated files, despite them being present in the build output.
-Are there any known issues with SvelteKit v2.36.3 + adapter-vercel v5.10.2?
-Could this be a build cache issue on Vercel’s end?
-Are there specific Node.js 20.x compatibility issues?
-Should we try a different build configuration or output directory?
Project Details
Framework: SvelteKit v2.36.3
Adapter: @sveltejs/adapter-vercel v5.10.2
Node.js: 20.x (explicitly specified)
Build Tool: Vite v7.1.3
CSS: TailwindCSS v4.1.12
Original Issue
Troubleshooting Steps Completed
-
Configuration Fixes
Package.json: Fixed build script to use “build”: “vite build” (SvelteKit v2.x standard)
Node.js Version: Added explicit “engines”: {“node”: “20.x”} specification
Runtime Config: Removed explicit runtime config to let Vercel auto-detect
Dependencies: Moved TailwindCSS packages to dependencies for deployment -
Build Verification
Local Build: npm run build works perfectly
File Generation: All required files are generated correctly
Syntax Validation: Both vercel-tmp/index.js and output/server/index.js have valid Node.js syntax -
Directory Structure Verification
Key Configuration Files
package.json
}
svelte.config.js
;
vercel.json
}
.gitignore
]
Build Output Verification
Build Command: npm run build executes successfully
Vercel Adapter: Reports “Using @sveltejs/adapter-vercel
done”
File Sizes: All files are properly generated (not empty/corrupted)
Import Resolution: vercel-tmp/index.js correctly imports from ../output/server/index.js
Current Status
Local Build: Working perfectly
File Generation: All required files present
Configuration: Optimized for Vercel deployment
Dependencies: Latest stable versions
Fresh Vercel Project: Ready for deployment
LOCAL TESTING RESULTS:
- Vercel CLI 46.0.5 runs successfully locally
- Dev server starts on http://localhost:5174/ without errors
- All dependencies and configurations work in local Vercel environment
- The issue appears to be specific to Vercel’s production deployment, not the local setup
james@jamess-mbp geogrow-fresh % vercel dev --listen 3000
Vercel CLI 46.0.5
> Running Dev Command “npm run dev”
> geogrow-fresh@0.0.1 dev
> vite dev
Port 5173 is in use, trying another one...
VITE v7.1.3 ready in 1362 ms
➜ Local: http://localhost:5174/
➜ Network: use --host to expose
➜ press h + enter to show help