#500 error on server-side not redirecting

5 messages · Page 1 of 1 (latest)

fleet laurel
#

When I get a 500 error on external api calls inside getServerSideProps it doesn't redirect to the error page but instead I get to see the following screen.

I've added a custom 500 page but I can't figure out why it won't redirect when it throws an error.

#

This is what I see in my console

#

In my getServerSideProps

export const getServerSideProps: GetServerSideProps = async () => {
  const response: any = await api.post(endpoints.getTermsAndConditions, {});
  const privacy = await markdownToHtml(response.data.privacy);

  return {
    props: {
      privacy,
    },
  };
};
#

(the response is deliberately broken to force a 500 error)

indigo field
#

Have you by any chance configured the pageExtensions property in next.config.js?