Skip to content

PPR - Static bail out error caught when using partial prerending nextjs #12061

@andrewdoro

Description

@andrewdoro

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

^8

Framework Version

No response

Link to Sentry event

https://tabtick.sentry.io/issues/369364/events/c792870db01e4425b2076500da9333af/

SDK Setup

sentry.server.config.ts

Sentry.init({
  dsn: process.env.SENTRY_DSN,

  // 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,

  // Uncomment the line below to enable Spotlight (https://spotlightjs.com)
  // spotlight: process.env.NODE_ENV === 'development',
  
});

Steps to Reproduce

  • have a next application with ppr enabled
/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    ppr: true,
  },
}
 
module.exports = nextConfig
  • have a request importing next/headers like cookies(), headers()

Expected Result

From next.js docs this is normal, and we shouldn't caught it
https://nextjs.org/docs/messages/ppr-caught-error

Actual Result

Sentry catches errors for routes that use ppr.
This is the error description:

Route /location/les-caves-du-roy-nightclub needs to bail out of prerendering at this point because it used headers. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs...

Screenshot 2024-05-16 at 10 16 31

Metadata

Metadata

Assignees

Labels

Package: 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