Next.js Discord

Discord Forum

Error on return a PDF

Unanswered
Oak rough bulletgall wasp posted this in #help-forum
Open in Discord
Avatar
Oak rough bulletgall waspOP
      const buffer = await renderToBuffer(
        <OtpsPdf event={eventFormatted} otps={data} />
      );

      return new Response(buffer, {
        headers: {
          "Content-Type": "application/pdf",
          "Content-Disposition": `attachment; filename="Codici: ${event.name}.pdf"`,
        },
      });
`

Why this code in a NextJS GET function return an Internal Server error in production (I have deployed on Vercel)

In development everthing works fine.

Thank you

0 Replies