-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.
@sentry/nextjs
SDK Version
7.44.2
Framework Version
Next 13.2.4 & Next Canary
Link to Sentry event
No response
SDK Setup
the default ones generated via npx @sentry/wizard -i nextjs
// This file configures the initialization of Sentry on the browser.
// The config you add here will be used whenever a page is visited.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs';
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
Sentry.init({
dsn: SENTRY_DSN || '<PROVIDE_DSN>',
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1.0,
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
Steps to Reproduce
- check out https://github.com/patshologram/revalidation-error-with-middleware
- search for
PROVIDE_and set the DSN, project and org name - start with
yarn build && yarn start - call http://localhost:3000/api/revalidate
Side-note: if sentry is removed from the next.config.js, on-demand revalidation works fine
Expected Result
On-demand revalidation can be executed without an error
Actual Result
Page changed from static to dynamic at runtime /, reason: headers
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error
at Object.staticGenerationBailout (/Users/martonpa/Sources/revalidation-error-with-middleware/.next/server/chunks/516.js:3704:21)
at headers (/Users/martonpa/Sources/revalidation-error-with-middleware/.next/server/chunks/516.js:3545:39)
at Object.apply (/Users/martonpa/Sources/revalidation-error-with-middleware/.next/server/app/page.js:172:84)
at Object.preloadComponent (/Users/martonpa/Sources/revalidation-error-with-middleware/node_modules/next/dist/server/app-render/preload-component.js:18:22)
at /Users/martonpa/Sources/revalidation-error-with-middleware/node_modules/next/dist/server/app-render/index.js:471:85
at async createComponentTree (/Users/martonpa/Sources/revalidation-error-with-middleware/node_modules/next/dist/server/app-render/index.js:471:29)
at async /Users/martonpa/Sources/revalidation-error-with-middleware/node_modules/next/dist/server/app-render/index.js:551:52
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK