From 0fd2f3ba98c44bb05df61b51a163081eea1644c8 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Sun, 6 Feb 2022 12:13:38 -0300 Subject: [PATCH 1/2] Add types to nextConfig in default template (#34029) Enable editors to suggest properties for the config object. Also let TypeScript check for type errors in the configuration when using TypeScript Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com> --- packages/create-next-app/templates/default/next.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/create-next-app/templates/default/next.config.js b/packages/create-next-app/templates/default/next.config.js index 0d6071006ab35..a843cbee09afa 100644 --- a/packages/create-next-app/templates/default/next.config.js +++ b/packages/create-next-app/templates/default/next.config.js @@ -1,3 +1,6 @@ -module.exports = { +/** @type {import('next').NextConfig} */ +const nextConfig = { reactStrictMode: true, } + +module.exports = nextConfig From 8039c6b2b564a82ee67d4abdaae0771cee5e69b7 Mon Sep 17 00:00:00 2001 From: Lakshya Thakur Date: Sun, 6 Feb 2022 20:51:28 +0530 Subject: [PATCH 2/2] fix: Change `url` to `nextUrl` inside delete-query-params-in-middlewares.md (#33796) Co-authored-by: JJ Kasper --- errors/deleting-query-params-in-middlewares.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errors/deleting-query-params-in-middlewares.md b/errors/deleting-query-params-in-middlewares.md index 676c5d903a3de..847efbb0bddc4 100644 --- a/errors/deleting-query-params-in-middlewares.md +++ b/errors/deleting-query-params-in-middlewares.md @@ -28,7 +28,7 @@ import { NextResponse } from 'next/server' export default function middleware(request: NextRequest) { const nextUrl = request.nextUrl nextUrl.pathname = '/dest' - return NextResponse.rewrite(url) + return NextResponse.rewrite(nextUrl) } ```