Next.js Discord

Discord Forum

Why does my build fail on Vercel with an upgrade to the stripe package but builds locally?

Unanswered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
I'm trying to track down why my build works locally, yet fails when sent to Vercel after upgrading some dependency modules. I rolled back to the last working deploy's package-lock.json file then did a binary search to find the culprit. None of my app's code was changed.

I'm on Next.js@14.2.5, typescript@5.5.4. Not sure what other relevant versions are. The build error I get on vercel:

Failed to compile.

./src/app/auth/signup/page.tsx:50:21
Type error: Parameter 'prev' implicitly has an 'any' type.
  48 |   useEffect(() => {
  49 |     if (errorParam) {
> 50 |       setFormErrors(prev => ({ ...prev, apiError: errorParam }));
     |                     ^
  51 |     }
  52 |   }, [errorParam]);
  53 |
Error: Command "npm run build" exited with 1


The entire difference in the project between getting this error and not getting this error (ie, successful build) is this:

--- package-lock-works.json    2024-08-22 11:02:28
+++ package-lock-fails.json    2024-08-22 11:03:18
@@ -16743,9 +16743,9 @@
       }
     },
     "node_modules/stripe": {
-      "version": "16.5.0",
-      "resolved": "https://registry.npmjs.org/stripe/-/stripe-16.5.0.tgz",
-      "integrity": "sha512-5qY2Va8pmnqS/dcKsQKJnk9kkYCtS6hqjN7kktZEmdxVohZHvbT9pOWK8UUKRInTXYkCNl6x505tO5416KLPsQ==",
+      "version": "16.7.0",
+      "resolved": "https://registry.npmjs.org/stripe/-/stripe-16.7.0.tgz",
+      "integrity": "sha512-BJCSEtqN8LJsPuPkjQmB/LlBl00uxi9FIPa6LNcF80ofMKqfnuervDhwWSZqCs6xJk/i9vx1D9lRoDnqSmym2w==",
       "license": "MIT",
       "dependencies": {
         "@types/node": ">=8.1.0",

1 Reply

Northeast Congo LionOP
I deploy using a Github action amondnet/vercel-action@v25 which has been working amazingly well for over a year. It just runs the deploy on Vercel's server for me and the logs are on the vercel dashboard. The signup/page.tsx file hasn't been updated in months and does not reference Stripe. I am getting this error again with other code changes, so I have no clue how to trace the root cause.