Skip to content

Commit 6768e49

Browse files
committed
feat(nextjs)!: Remove experimental_captureRequestError (#14607)
Fixes #14302
1 parent 3e1a3c8 commit 6768e49

File tree

5 files changed

+8
-19
lines changed

5 files changed

+8
-19
lines changed

dev-packages/e2e-tests/test-applications/nextjs-t3/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"@trpc/react-query": "^11.0.0-rc.446",
2222
"@trpc/server": "^11.0.0-rc.446",
2323
"geist": "^1.3.0",
24-
"next": "^14.2.4",
25-
"react": "^18.3.1",
26-
"react-dom": "^18.3.1",
24+
"next": "14.2.4",
25+
"react": "18.3.1",
26+
"react-dom": "18.3.1",
2727
"server-only": "^0.0.1",
2828
"superjson": "^2.2.1",
2929
"zod": "^3.23.3"

dev-packages/e2e-tests/test-applications/nextjs-t3/src/trpc/server.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'server-only';
22

33
import { createHydrationHelpers } from '@trpc/react-query/rsc';
44
import { headers } from 'next/headers';
5-
import { cache } from 'react';
65

76
import { type AppRouter, createCaller } from '~/server/api/root';
87
import { createTRPCContext } from '~/server/api/trpc';
@@ -12,16 +11,16 @@ import { createQueryClient } from './query-client';
1211
* This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when
1312
* handling a tRPC call from a React Server Component.
1413
*/
15-
const createContext = cache(() => {
14+
const createContext = () => {
1615
const heads = new Headers(headers());
1716
heads.set('x-trpc-source', 'rsc');
1817

1918
return createTRPCContext({
2019
headers: heads,
2120
});
22-
});
21+
};
2322

24-
const getQueryClient = cache(createQueryClient);
23+
const getQueryClient = createQueryClient;
2524
const caller = createCaller(createContext);
2625

2726
export const { trpc: api, HydrateClient } = createHydrationHelpers<AppRouter>(caller, getQueryClient);

packages/nextjs/src/common/captureRequestError.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,3 @@ export function captureRequestError(error: unknown, request: RequestInfo, errorC
4141
});
4242
});
4343
}
44-
45-
/**
46-
* Reports errors passed to the the Next.js `onRequestError` instrumentation hook.
47-
*
48-
* @deprecated Use `captureRequestError` instead.
49-
*/
50-
// TODO(v9): Remove this export
51-
export const experimental_captureRequestError = captureRequestError;

packages/nextjs/src/common/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ export { wrapMiddlewareWithSentry } from './wrapMiddlewareWithSentry';
1111
export { wrapPageComponentWithSentry } from './pages-router-instrumentation/wrapPageComponentWithSentry';
1212
export { wrapGenerationFunctionWithSentry } from './wrapGenerationFunctionWithSentry';
1313
export { withServerActionInstrumentation } from './withServerActionInstrumentation';
14-
// eslint-disable-next-line deprecation/deprecation
15-
export { experimental_captureRequestError, captureRequestError } from './captureRequestError';
14+
export { captureRequestError } from './captureRequestError';

packages/nextjs/src/index.types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,4 @@ export declare function wrapApiHandlerWithSentryVercelCrons<F extends (...args:
142142
*/
143143
export declare function wrapPageComponentWithSentry<C>(WrappingTarget: C): C;
144144

145-
// eslint-disable-next-line deprecation/deprecation
146-
export { experimental_captureRequestError, captureRequestError } from './common/captureRequestError';
145+
export { captureRequestError } from './common/captureRequestError';

0 commit comments

Comments
 (0)