Skip to content

ERR_INVALID_CHAR invalid character in header content ["Location"] #11707

@rbracco

Description

@rbracco

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.111.0

Framework Version

React 18.2.0 / Next 13.3.1

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: "https://23ef9278507cc545de3c0fb57ffcd5ea@o4507119507210240.ingest.us.sentry.io/4507119553216512",

  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1,

  // Setting this option to true will print useful information to the console while you're setting up Sentry.
  debug: false,

  replaysOnErrorSampleRate: 1.0,

  // This sets the sample rate to be 10%. You may want this to be 100% while
  // in development and sample at a lower rate in production
  replaysSessionSampleRate: 0.1,

  // You can remove this option if you're not planning to use the Sentry Session Replay feature:
  integrations: [
    Sentry.replayIntegration({
      // Additional Replay configuration goes in here, for example:
      maskAllText: true,
      blockAllMedia: true,
    }),
  ],
});

Steps to Reproduce

I added Sentry following the docs, and it works in dev, but when I deploy to digital ocean app platform, my frontend (nextjs) deployment fails. When I check the runtime logs I see TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Location"]

image

When I roll back one commit (before adding sentry, no other changes) the deployment is successful and this error goes away.

Expected Result

To deploy without failing

Actual Result

It builds successfully and then fails during deploy with 'Deploy Error: Container Terminated".

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions