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,