From bc854ddfb102b490a762886481fa6fdc9fb24b59 Mon Sep 17 00:00:00 2001 From: devjiwonchoi Date: Tue, 21 Oct 2025 22:29:06 -0700 Subject: [PATCH 1/4] docs: proxy runtime defaults to nodejs --- .../03-api-reference/03-file-conventions/proxy.mdx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx index c771197d969e1a..87999af14047f2 100644 --- a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx +++ b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx @@ -190,18 +190,26 @@ Proxy will be invoked for **every route in your project**. Given this, it's cruc ## Runtime -Proxy defaults to using the Edge runtime. As of v15.5, we have support for using the Node.js runtime. To enable, in your proxy file, set the runtime to `nodejs` in the `config` object: +Proxy defaults to using the Node.js runtime. The [`runtime`](/docs/app/api-reference/file-conventions/route-segment-config#runtime) config option is not available in Proxy files. ```js highlight={2} filename="proxy.js" switcher +// Setting the runtime config in Proxy will throw an error. + export const config = { - runtime: 'nodejs', + runtime: 'edge', } + +export const runtime = 'edge' ``` ```ts highlight={2} filename="proxy.ts" switcher +// Setting the runtime config in Proxy will throw an error. + export const config = { - runtime: 'nodejs', + runtime: 'edge', } + +export const runtime = 'edge' ``` ## Advanced Proxy flags From c9743366c2aa4e993ca0fb438eb04eb8db76062e Mon Sep 17 00:00:00 2001 From: devjiwonchoi Date: Tue, 21 Oct 2025 22:29:40 -0700 Subject: [PATCH 2/4] remove highlight --- docs/01-app/03-api-reference/03-file-conventions/proxy.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx index 87999af14047f2..cc1cf513ee9521 100644 --- a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx +++ b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx @@ -192,7 +192,7 @@ Proxy will be invoked for **every route in your project**. Given this, it's cruc Proxy defaults to using the Node.js runtime. The [`runtime`](/docs/app/api-reference/file-conventions/route-segment-config#runtime) config option is not available in Proxy files. -```js highlight={2} filename="proxy.js" switcher +```js filename="proxy.js" switcher // Setting the runtime config in Proxy will throw an error. export const config = { @@ -202,7 +202,7 @@ export const config = { export const runtime = 'edge' ``` -```ts highlight={2} filename="proxy.ts" switcher +```ts filename="proxy.ts" switcher // Setting the runtime config in Proxy will throw an error. export const config = { From 57ce409a5bae8bcb0ea5d86238a88e62033a06bb Mon Sep 17 00:00:00 2001 From: devjiwonchoi Date: Tue, 21 Oct 2025 22:39:23 -0700 Subject: [PATCH 3/4] use diff to emphasize the removal --- .../03-file-conventions/proxy.mdx | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx index cc1cf513ee9521..e66fc73d402691 100644 --- a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx +++ b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx @@ -190,26 +190,14 @@ Proxy will be invoked for **every route in your project**. Given this, it's cruc ## Runtime -Proxy defaults to using the Node.js runtime. The [`runtime`](/docs/app/api-reference/file-conventions/route-segment-config#runtime) config option is not available in Proxy files. - -```js filename="proxy.js" switcher -// Setting the runtime config in Proxy will throw an error. - -export const config = { - runtime: 'edge', -} - -export const runtime = 'edge' -``` - -```ts filename="proxy.ts" switcher -// Setting the runtime config in Proxy will throw an error. - -export const config = { - runtime: 'edge', -} - -export const runtime = 'edge' +Proxy defaults to using the Node.js runtime. The [`runtime`](/docs/app/api-reference/file-conventions/route-segment-config#runtime) config option is not available in Proxy files. Setting the `runtime` config option in Proxy will throw an error. + +```diff filename="proxy.ts" +-export const config = { +- runtime: 'edge', +- } +- +- export const runtime = 'edge' ``` ## Advanced Proxy flags From bf8edef45654dfd265a6d392f651ab00fae00280 Mon Sep 17 00:00:00 2001 From: Jiwon Choi Date: Wed, 22 Oct 2025 13:19:07 -0700 Subject: [PATCH 4/4] Remove diff --- .../01-app/03-api-reference/03-file-conventions/proxy.mdx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx index e66fc73d402691..391b7f971943ed 100644 --- a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx +++ b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx @@ -192,14 +192,6 @@ Proxy will be invoked for **every route in your project**. Given this, it's cruc Proxy defaults to using the Node.js runtime. The [`runtime`](/docs/app/api-reference/file-conventions/route-segment-config#runtime) config option is not available in Proxy files. Setting the `runtime` config option in Proxy will throw an error. -```diff filename="proxy.ts" --export const config = { -- runtime: 'edge', -- } -- -- export const runtime = 'edge' -``` - ## Advanced Proxy flags In `v13.1` of Next.js two additional flags were introduced for proxy, `skipMiddlewareUrlNormalize` and `skipTrailingSlashRedirect` to handle advanced use cases.