Skip to content

Error: Route "" used searchParams.__sentry_skip_normalization__. searchParams should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis  #16542

Closed

Description

@m-nathani

Route Navigation Errors with sendDefaultPii Configuration

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

9.28.0

Framework Version

React 19 and Next 15.3.3

Link to Sentry event

No response

Reproduction Example/SDK Setup

Environment

  • Package: @sentry/nextjs ( 9.28.0)
  • Framework: Next.js 15
  • Configuration Files: sentry.edge.config.ts and/or sentry.server.config.ts

Issue Description

After updating to the latest version of @sentry/nextjs and adding the sendDefaultPii: true configuration option, navigation between routes triggers invalid parameter-related errors that prevent proper route transitions.

sentry.edge.config.ts

// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
// The config you add here will be used whenever one of the edge features is loaded.
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import { env } from '@/env';
import * as Sentry from '@sentry/nextjs';

Sentry.init({
  dsn: env.NEXT_PUBLIC_SENTRY_DSN,
  environment: env.NEXT_PUBLIC_APP_ENV,

  // Adds request headers and IP for users, for more info visit:
  // https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
  sendDefaultPii: true,

  // Define how likely traces are sampled.
  tracesSampleRate: env.NEXT_PUBLIC_APP_ENV === 'production' ? 0.1 : 0.6,

  // Setting this option to true will print useful information to the console while you're setting up Sentry.
  debug: false,
});

sentry.server.config.ts

// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import { env } from '@/env';
import * as Sentry from '@sentry/nextjs';

Sentry.init({
  dsn: env.NEXT_PUBLIC_SENTRY_DSN,
  environment: env.NEXT_PUBLIC_APP_ENV,

    // Adds request headers and IP for users, for more info visit:
  // https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
  sendDefaultPii: true,

  // Define how likely traces are sampled.
  tracesSampleRate: env.NEXT_PUBLIC_APP_ENV === 'production' ? 0.1 : 0.6,

  // Setting this option to true will print useful information to the console while you're setting up Sentry.
  debug: false,
});

Steps to Reproduce

Steps to Reproduce

  1. Update @sentry/nextjs to the latest version
  2. Add the following configuration to sentry.edge.config.ts or sentry.server.config.ts:
    // Adds request headers and IP for users, for more info visit:
    // https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
    sendDefaultPii: true,
  3. Navigate between routes in the Next.js application
  4. Observe route navigation errors related to invalid parameters

Workaround

The issue is resolved by either:

  • Downgrading @sentry/nextjs to a previous version, OR
  • Removing the sendDefaultPii: true configuration

Additional Context

  • The errors specifically mention issues with route parameters
  • The parameter errors appear to be false positives as they disappear when the Sentry configuration is modified
  • This suggests the sendDefaultPii option may be interfering with Next.js's internal route parameter handling or validation

Expected Result

Expected Behavior

Route navigation should work normally without throwing parameter-related errors when sendDefaultPii is enabled.

Impact

This prevents users from enabling PII collection for better debugging context while maintaining stable route navigation in their Next.js applications.

Actual Result

Actual Behavior

Navigation between routes fails with parameter validation errors that appear to be invalid/spurious.

> next dev -p 3012

   ▲ Next.js 15.3.3
   - Local:        http://localhost:3012
   - Network:      http://192.168.0.160:3012
   - Environments: .env
   - Experiments (use with caution):
     · clientTraceMetadata

 ✓ Starting...
 ○ Compiling /instrumentation ...
 ✓ Compiled /instrumentation in 9.5s (938 modules)
 ✓ Ready in 16.2s
 ○ Compiling /middleware ...
 ✓ Compiled /middleware in 1673ms (624 modules)
 ○ Compiling /[locale]/partner/[slug] ...
 ✓ Compiled /[locale]/partner/[slug] in 13s (3514 modules)
 GET /en/partner/kwc-singapore 200 in 18157ms
Error: Route "/[locale]/partner/[slug]" used `...params` or similar expression. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
Error: Route "/[locale]/partner/[slug]" used `params.locale`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
Error: Route "/[locale]/partner/[slug]" used `params.slug`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
Error: Route "/[locale]/partner/[slug]" used `searchParams.__isVue`. `searchParams` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
Error: Route "/[locale]/partner/[slug]" used `searchParams._isVue`. `searchParams` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
Error: Route "/[locale]/partner/[slug]" used `searchParams.__sentry_skip_normalization__`. `searchParams` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
Error: Route "/[locale]/partner/[slug]" used `searchParams.__sentry_override_normalization_depth__`. `searchParams` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
Error: Route "/[locale]/partner/[slug]" used `Object.keys(searchParams)` or similar. `searchParams` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)
    at Array.forEach (<anonymous>)

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 11, 2025
  2. changed the title [-]Error: Route "/[locale]/partner/[slug]" used `searchParams.__sentry_skip_normalization__`. `searchParams` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis[/-] [+]Error: Route "" used `searchParams.__sentry_skip_normalization__`. `searchParams` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis [/+] on Jun 11, 2025
  3. Lms24 commented on Jun 11, 2025

    @Lms24
    Member

    Hey @m-nathani thanks for reporting this!

    I've found one location in our code where this error could be coming from:

    if (getClient()?.getOptions().sendDefaultPii) {
    const props: unknown = args[0];
    const params = props && typeof props === 'object' && 'params' in props ? props.params : undefined;
    const searchParams =
    props && typeof props === 'object' && 'searchParams' in props ? props.searchParams : undefined;
    data = { params, searchParams };
    }

    Downgrading @sentry/nextjs to a previous version,

    Can you tell me which version still works for you? This will help us to narrow it down further.

    Also just to confirm: Do you only get these errors in your server console logs or also client-side in the browser console?

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 11, 2025
  5. m-nathani commented on Jun 11, 2025

    @m-nathani
    Author

    Downgrading @sentry/nextjs to a previous version,

    Currently i was on 9.23.0 and upgraded to 9.28.0, however not exactly sure between 9.23.0 to 9.28.0 which one has issue in it

    Also just to confirm: Do you only get these errors in your server console logs or also client-side in the browser console?

    Server side logs

    what should be workaround for this by the time? would be better to remove sendDefaultPii or downgrade ?

  6. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 11, 2025
  7. Lms24 commented on Jun 11, 2025

    @Lms24
    Member

    Thanks for getting back to me! I'll try to reproduce and narrow it down further with the version margin.

    If you don't need a specific feature from the newer versions, I'd recommend downgrading, since you might miss data that's gated with sendDefaultPii.

  8. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 11, 2025
  9. 37 remaining items

  10. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 30, 2025
  11. DanishNasarudin commented on Jul 1, 2025

    @DanishNasarudin

    Having the same issue, version 9.33.0.

    Removing sendDefaultPii: true from both edge and server config, 'fixed' the issue temporarily.

    Error log for my case:

    Error: Route "/" used `...params` or similar expression. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
        at Function.entries (<anonymous>)
        at Object.apply (webpack-internal:/(rsc)/app/sentry-wrapper-module:47:9)
      45 |         baggageHeader,
      46 |         headers,
    > 47 |       }).apply(thisArg, args);
         |         ^
      48 |     },
      49 |   });
      50 | } else {
    
  12. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 1, 2025
  13. andreiborza commented on Jul 1, 2025

    @andreiborza
    Member

    Hi, we're working on a fix. Thanks for reporting in.

  14. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 1, 2025
  15. self-assigned this
    on Jul 24, 2025
  16. github-actions commented on Jul 31, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #17162, which was included in the 10.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions