Closed
Description
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
- 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;
- Deploy to Vercel
- Open page
- Observe that no error has been reported to Sentry