From c2a77f16221f167009f2a2d2db15eff63d4ec9ce Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Tue, 17 Dec 2024 22:19:11 -0500 Subject: [PATCH] Update router.ts Co-authored-by: JJ Kasper --- packages/next/src/shared/lib/router/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/shared/lib/router/router.ts b/packages/next/src/shared/lib/router/router.ts index 42d2784c3e916..9751783208f9c 100644 --- a/packages/next/src/shared/lib/router/router.ts +++ b/packages/next/src/shared/lib/router/router.ts @@ -499,7 +499,7 @@ function fetchNextData({ {} as HeadersInit, isPrefetch ? { purpose: 'prefetch' } : {}, isPrefetch && hasMiddleware ? { 'x-middleware-prefetch': '1' } : {}, - { 'x-deployment-id': process.env.NEXT_DEPLOYMENT_ID } + process.env.NEXT_DEPLOYMENT_ID ? { 'x-deployment-id': process.env.NEXT_DEPLOYMENT_ID } : {} ), method: params?.method ?? 'GET', })