Vercel function crashes on any network request

Recently, my react-router project started failing on a POST request. It’s weird since it does not do much, just a FETCH request.

I then narrowed it down to, whenever FETCH gets called, something crashes hardcore and I can’t even catch the error, no idea why.
It works locally perfectly, but when deployed, errors

The logs on the platform say nothing

I’ve managed to reproduce the issue in a simple repo, basically created using Vercel’s templates and added one commit

The expected output is of course a 200 and both before and after console messages being printed, or in a bad case, the ERROR from the catch. We get the before but nothing after

Using httpie

http --verify=no POST https://react-router-bug.vercel.app/test

then we get

PS: tried using axios as well, same issue

1 Like

I’ve been trying to debug this error too today.

  • Only happens for POST requests, not GET.
  • Old deployment still works.
  • New deployment made from the same commit fails.

I deployed a patched version of react-router that disables sanitizeError and got this traceback:

DOMException [AbortError]: This operation was aborted
    at new DOMException (node:internal/per_context/domexception:53:5)
    at AbortController.abort (node:internal/abort_controller:465:18)
    at IncomingMessage.<anonymous> (/opt/rust/nodejs.js:2:1816)
    at Object.onceWrapper (node:events:632:28)
    at IncomingMessage.emit (node:events:518:28)
    at emitCloseNT (node:internal/streams/destroy:148:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21)

Also, the request does successfully complete, and by adding logging to the promise in the background I have sometimes got it to log the result of the request.
It appears that it’s just the response stream that is getting aborted.

3 Likes

I can reproduce this, escalating internally

2 Likes

This should be fixed now, try redeploying and let me know if it works for you

@jacobparis it does work now! Both in the test project and in the real one
Thank you so much!

Can you share what happened, just out of sheer curiosity? If not it’s ok :smiley:

1 Like

Can also confirm it’s now working. Would also love to hear what happened :slight_smile:

1 Like

Thanks for confirming!

There was a new version of the runtime that made a few changes, which is why it only broke on new deploys but not old ones. I don’t know too much beyond that yet

2 Likes

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