From 689a4de3dc5643f01af549d9b7659918850df558 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 16 Feb 2022 12:07:39 -0600 Subject: [PATCH] add check before setting query --- packages/next/server/base-server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/server/base-server.ts b/packages/next/server/base-server.ts index 1fa11226f7fc2..77160619770fe 100644 --- a/packages/next/server/base-server.ts +++ b/packages/next/server/base-server.ts @@ -1550,7 +1550,9 @@ export default abstract class Server { res.body('{"notFound":true}').send() return null } else { - query.__nextNotFoundSrcPage = pathname + if (this.renderOpts.dev) { + query.__nextNotFoundSrcPage = pathname + } await this.render404( req, res,