Skip to content

Vercel integration is causing runtime errors in undici integration #12218

@bryanrsmith

Description

@bryanrsmith

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

^7.101.1

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Sometime between the evening of May 23 and morning of May 24 all of my Vercel projects that use @sentry/node have started producing runtime errors when using native fetch (undici). I have made no relevant code changes in that time frame (deployments are being triggered by webhooks from my CMS). Projects build successfully as normal, but my pre-deployment tests fail, preventing Vercel from aliasing the new deployments to production. All serverless functions that make fetch calls appear to be crashing with the following error:

TypeError: request.headers.split is not a function
at setHeadersOnRequest (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:266:39)
at _onRequestCreate (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:177:7)
at Channel.publish (node:diagnostics_channel:143:9)
at new Request (node:internal/deps/undici/undici:6295:27)
at Client.[dispatch] (node:internal/deps/undici/undici:9077:25)
at Intercept (node:internal/deps/undici/undici:8812:20)
at Client.[Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16)
at Client.dispatch (node:internal/deps/undici/undici:5689:44)
at Pool.[dispatch] (node:internal/deps/undici/undici:5920:32)
at Pool.[Intercepted Dispatch] (node:internal/deps/undici/undici:5666:33)
Node.js process exited with exit status: 129. The logs above can help with debugging the issue.

Disabling Sentry by commenting out the Sentry.init() call has allowed me to resume deploying my projects.

Expected Result

Sentry instrumentation shouldn't break the app :-)

Actual Result

All node.js serverless functions crash with the following error:

TypeError: request.headers.split is not a function
at setHeadersOnRequest (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:266:39)
at _onRequestCreate (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:177:7)
at Channel.publish (node:diagnostics_channel:143:9)
at new Request (node:internal/deps/undici/undici:6295:27)
at Client.[dispatch] (node:internal/deps/undici/undici:9077:25)
at Intercept (node:internal/deps/undici/undici:8812:20)
at Client.[Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16)
at Client.dispatch (node:internal/deps/undici/undici:5689:44)
at Pool.[dispatch] (node:internal/deps/undici/undici:5920:32)
at Pool.[Intercepted Dispatch] (node:internal/deps/undici/undici:5666:33)
Node.js process exited with exit status: 129. The logs above can help with debugging the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions