Vercel build error by esbuild
Unanswered
Common paper wasp posted this in #help-forum
Common paper waspOP
I'm getting following error when I push my code to vercel:
Everything works fine in local.
I even did
Tried deleting package-lock and nodemodules and reinstalling, issue persists.
This is my package.json:
I'm going insane.
npm error code 1
npm error path /vercel/path0/node_modules/tsx/node_modules/esbuild
npm error command failed
npm error command sh -c node install.js
npm error /vercel/path0/node_modules/tsx/node_modules/esbuild/install.js:136
npm error throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`);
npm error ^
npm error Error: Expected "0.25.9" but got "0.19.12"
npm error at validateBinaryVersion (/vercel/path0/node_modules/tsx/node_modules/esbuild/install.js:136:11)
npm error at /vercel/path0/node_modules/tsx/node_modules/esbuild/install.js:287:5
npm error Node.js v22.18.0
npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-08-23T20_21_44_600Z-debug-0.log
Error: Command "npm install --prefix=../.." exited with 1
Everything works fine in local.
I even did
"overrides": {
"esbuild": "0.25.9"
}
Tried deleting package-lock and nodemodules and reinstalling, issue persists.
This is my package.json:
{
...
"dependencies": {
"@hookform/resolvers": "^5.2.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"lucide-react": "^0.541.0",
"next": "^15.2.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.62.0",
"react-phone-number-input": "^3.4.12",
"tailwind-merge": "^3.3.1",
"validator": "^13.15.15",
"postcss": "^8.5.6",
"tailwindcss": "^4.1.12",
"@tailwindcss/postcss": "^4.1.12",
"tw-animate-css": "^1.3.7",
"zod": "^4.1.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/validator": "^13.15.2",
"eslint": "^9",
"eslint-config-next": "15.5.0",
"typescript": "^5"
},
"overrides": {
"esbuild": "0.25.9"
}
}
I'm going insane.
21 Replies
@Dutch is your package.json has `esbuild: 0.19.12`
Common paper waspOP
Where i dont see it
you talking about override? its 0.25.9 tho
@Common paper wasp Where i dont see it
Dutch
In dependencies
@Dutch In dependencies
Common paper waspOP
I dont have esbuild in dependencies
Are you trolling by any chance?
@Common paper wasp Are you trolling by any chance?
Dutch
Sorry it's TSX s esbuild dependency
Upgrade your node version from project settings at vercel first. Second remove node modules and npm cache and try again
Common paper waspOP
node version at vercel is 22.x
I already removed node modules ,package-lock many times.
I already removed node modules ,package-lock many times.
@Common paper wasp node version at vercel is 22.x
I already removed node modules ,package-lock many times.
Dutch
Is it same when you build local
Common paper waspOP
local is v21.2.0
@Common paper wasp local is v21.2.0
Dutch
No i mean do you get same error at local build
@Dutch No i mean do you get same error at local build
Common paper waspOP
Nope not at all
@Common paper wasp Nope not at all
Dutch
is your npm install command different than npm install at vercel
@Dutch is your npm install command different than npm install at vercel
Common paper waspOP
Nope exact same
I deleted the app on vercel and hosted it again, it fixed
But after another code push, the next build throw same error
This is getting annoying
@Common paper wasp This is getting annoying
Dutch
Try to reach vercel support
Or host it somewhere else
Common paper waspOP
Such a shame!