Skip to content

Errors aren't being reported in Next.js data-fetching methods on Vercel #6117

Closed
@lforst

Description

@lforst

When run on Vercel, the Next.js SDK currently doesn't capture any errors thrown in Next.js data fetching methods. The runtime just quits without reporting the error.

Steps to reproduce

  1. Have page with data fetcher and autoInstrumentServerFunctions (which is on by default):
const MyComponent = () => {
  return <h1>Hello World!</h1>;
};

export const getServerSideProps = async (context) => {
  if (context.params?.myParam === "two") {
    // only throw conditionally so that this page actually builds
    throw new Error("We don't like page two!");
  }

  return { props: {} };
};

export default MyComponent;
  1. Deploy to Vercel
  2. Open page
  3. Observe that no error has been reported to Sentry

Metadata

Metadata

Assignees

Labels

Package: nextjsIssues related to the Sentry Nextjs SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions