You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(nextjs): Support new async APIs (headers(), params, searchParams) (#13828)
Changes in Next.js vercel/next.js#68812
This PR is mostly just adjusting our E2E tests so they don't fail while
building.
Additionally, we had to update the `withServerActionInstrumentation` API
in a semver-minor way so you can pass a promise to the `headers` option.
The `ReadonlyHeaders` type isn't exposed in all Next.js versions so for
now I typed it as `any`.
Resolves#13805Resolves#13779Resolves#13780
// We need to dynamically check for this because Next.js made the API async for Next.js 15 and we use this test in canary tests
12
+
constnormalizedSearchParams=awaitsearchParams;
13
+
15
14
Sentry.setTag('my-isolated-tag',true);
16
15
Sentry.setTag('my-global-scope-isolated-tag',getDefaultIsolationScope().getScopeData().tags['my-isolated-tag']);// We set this tag to be able to assert that the previously set tag has not leaked into the global isolation scope
Copy file name to clipboardexpand all lines: dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/client-component/parameter/[...parameters]/page.tsx
Copy file name to clipboardexpand all lines: dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/client-component/parameter/[parameter]/page.tsx
Copy file name to clipboardexpand all lines: dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/server-component/parameter/[...parameters]/page.tsx
Copy file name to clipboardexpand all lines: dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/server-component/parameter/[parameter]/page.tsx
Copy file name to clipboardexpand all lines: packages/nextjs/src/common/withServerActionInstrumentation.ts
+17-5
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,18 @@ import { vercelWaitUntil } from './utils/vercelWaitUntil';
15
15
16
16
interfaceOptions{
17
17
formData?: FormData;
18
-
headers?: Headers;
18
+
19
+
/**
20
+
* Headers as returned from `headers()`.
21
+
*
22
+
* Currently accepts both a plain `Headers` object and `Promise<ReadonlyHeaders>` to be compatible with async APIs introduced in Next.js 15: https://github.com/vercel/next.js/pull/68812
0 commit comments