Skip to content

feat(nextjs): Switch to randomized tunnel route as default #1011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- feat(nextjs): Switch to randomized tunnel route as default ([#1011](https://github.com/getsentry/sentry-wizard/pull/1011))

## 5.1.0

- feat(nextjs): Add template for generateMetadata in App router for next@14 ([#1003](https://github.com/getsentry/sentry-wizard/pull/1003))
Expand Down
3 changes: 2 additions & 1 deletion src/nextjs/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export function getWithSentryConfigOptionsTemplate({
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
${tunnelRoute ? '' : '// '}tunnelRoute: "/monitoring",
// Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string.
${tunnelRoute ? '' : '// '}tunnelRoute: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
Expand Down
7 changes: 4 additions & 3 deletions test/nextjs/templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
tunnelRoute: true,
});

expect(template).toMatchInlineSnapshot(`

Check failure on line 260 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (20) Unit Tests (macos-15)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS 1` mismatched - Expected + Received @@ -16,10 +16,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:260:24

Check failure on line 260 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (18) Unit Tests (ubuntu-latest)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS 1` mismatched - Expected + Received @@ -16,10 +16,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:260:24

Check failure on line 260 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (20) Unit Tests (ubuntu-latest)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS 1` mismatched - Expected + Received @@ -16,10 +16,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:260:24

Check failure on line 260 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (18) Unit Tests (macos-15)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS 1` mismatched - Expected + Received @@ -16,10 +16,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:260:24

Check failure on line 260 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (22) Unit Tests (macos-15)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS 1` mismatched - Expected + Received @@ -16,10 +16,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:260:24

Check failure on line 260 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (22) Unit Tests (ubuntu-latest)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for SaaS 1` mismatched - Expected + Received @@ -16,10 +16,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:260:24
"{
// For all available options, see:
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
Expand All @@ -278,7 +278,7 @@
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",
tunnelRoute: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
Expand All @@ -301,7 +301,7 @@
tunnelRoute: true,
});

expect(template).toMatchInlineSnapshot(`

Check failure on line 304 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (20) Unit Tests (macos-15)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted 1` mismatched - Expected + Received @@ -17,10 +17,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:304:24

Check failure on line 304 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (18) Unit Tests (ubuntu-latest)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted 1` mismatched - Expected + Received @@ -17,10 +17,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:304:24

Check failure on line 304 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (20) Unit Tests (ubuntu-latest)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted 1` mismatched - Expected + Received @@ -17,10 +17,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:304:24

Check failure on line 304 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (18) Unit Tests (macos-15)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted 1` mismatched - Expected + Received @@ -17,10 +17,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:304:24

Check failure on line 304 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (22) Unit Tests (macos-15)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted 1` mismatched - Expected + Received @@ -17,10 +17,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:304:24

Check failure on line 304 in test/nextjs/templates.test.ts

View workflow job for this annotation

GitHub Actions / Node (22) Unit Tests (ubuntu-latest)

test/nextjs/templates.test.ts > Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted

Error: Snapshot `Next.js code templates > getWithSentryConfigOptionsTemplate > generates options for self-hosted 1` mismatched - Expected + Received @@ -17,10 +17,11 @@ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. // This can increase your server load as well as your hosting bill. // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. + // Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string. tunnelRoute: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, ❯ test/nextjs/templates.test.ts:304:24
"{
// For all available options, see:
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
Expand All @@ -323,7 +323,7 @@
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",
tunnelRoute: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
Expand Down Expand Up @@ -367,7 +367,8 @@
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
// tunnelRoute: "/monitoring",
// Setting this to "true" will create a randomized route on each build. You can also provide a static route as a string.
// tunnelRoute: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
Expand Down
Loading