Intermittent 500 / 405 / 429 errors on previously good deploy

I have an issue with a preview deployment. I have reverted to a previously known good deploy but having same issues.

The site often errors with:

500: INTERNAL_SERVER_ERROR
Code: INTERNAL_UNEXPECTED_ERROR
ID: lhr1::24sdb-1742511056156-f11744c628d1

If it does load there is a console.errors and the associated network requests fail with 500 / 405 / 429 errors.

The deploy is the same as is currently on prod (working fine)

Logs:

INTERNAL_UNEXPECTED_ERROR

Uncaught Exception: TypeError: Cannot create proxy with a non-object as target or handler
    at <unknown> (.next/server/instrumentation.js:5:27653)
    at Server.<anonymous> (.next/server/instrumentation.js:5:28006)
    at <unknown> (.next/server/instrumentation.js:25:9731)
    at <unknown> (.next/server/instrumentation.js:25:37290)
    at t.with (.next/server/instrumentation.js:25:55320)
    at t.with (.next/server/instrumentation.js:25:38980)
    at e.with (.next/server/instrumentation.js:2:58445)
    at Object.withSetIsolationScope (.next/server/instrumentation.js:25:37269)
    at t.withIsolationScope (.next/server/instrumentation.js:1:17744)
Node.js process exited with exit status: 129. The logs above can help with debugging the issue.

But no code lines are ever referenced so tricky to debug.

Any advice?

Hi @robhadfield, welcome to the Vercel Community!

Sorry that your project is facing these issues. Can you share if you made any recent code changes? Such as adding new dependencies or using a different runtime than before.

If not, can you please share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.

Hey @anshumanb :slight_smile:

I don’t have a public repo I’m afraid.

I’ve never seen anything like this before… The Staging branch is identical to Production and there are no differences (as far as I’m aware) between the environments.

It builds and starts OK locally which uses the same DB etc.

The logs only state what I showed above.

What I’ve tried:

  • Reverting any code changes to a good known commit
  • Removing added env variables
  • Redeploying to Vercel

What can we try? Happy to share code with you privately.

Do you have any further logs based on that error ID?

Thanks
Rob

OK!

It looks like it’s related to Sentry config. I removed the NEXT_PUBLIC_SENTRY_DSN for staging and redeployed and it’s now working.

I removed the env var and it works! Yay!
I added it back and it works! Oh…

Go figure?

Hi @robhadfield, thanks for sharing the solution. Keep us updated if this pops up again.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.