Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d8cde2a5
Unverified
Commit
d8cde2a5
authored
Oct 28, 2025
by
Jiwon Choi
Committed by
GitHub
Oct 28, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: build CLI output not displaying Proxy (Middleware) when nodejs runtime (#85403)
parent
afbdae65
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
2 deletions
+49
-2
index.ts
packages/next/src/build/index.ts
+1
-0
utils.ts
packages/next/src/build/utils.ts
+9
-2
layout.tsx
.../production/app-dir/proxy-build-cli-output/app/layout.tsx
+8
-0
page.tsx
test/production/app-dir/proxy-build-cli-output/app/page.tsx
+3
-0
next.config.js
.../production/app-dir/proxy-build-cli-output/next.config.js
+6
-0
proxy-build-cli-output.test.ts
...dir/proxy-build-cli-output/proxy-build-cli-output.test.ts
+14
-0
proxy.ts
test/production/app-dir/proxy-build-cli-output/proxy.ts
+8
-0
No files found.
packages/next/src/build/index.ts
View file @
d8cde2a5
...
@@ -4268,6 +4268,7 @@ export default async function build(
...
@@ -4268,6 +4268,7 @@ export default async function build(
pageExtensions
:
config
.
pageExtensions
,
pageExtensions
:
config
.
pageExtensions
,
buildManifest
,
buildManifest
,
middlewareManifest
,
middlewareManifest
,
functionsConfigManifest
,
hasGSPAndRevalidateZero
,
hasGSPAndRevalidateZero
,
})
})
)
)
...
...
packages/next/src/build/utils.ts
View file @
d8cde2a5
...
@@ -75,6 +75,7 @@ import { formatExpire, formatRevalidate } from './output/format'
...
@@ -75,6 +75,7 @@ import { formatExpire, formatRevalidate } from './output/format'
import
type
{
AppRouteRouteModule
}
from
'../server/route-modules/app-route/module'
import
type
{
AppRouteRouteModule
}
from
'../server/route-modules/app-route/module'
import
{
formatIssue
,
isRelevantWarning
}
from
'../shared/lib/turbopack/utils'
import
{
formatIssue
,
isRelevantWarning
}
from
'../shared/lib/turbopack/utils'
import
type
{
TurbopackResult
}
from
'./swc/types'
import
type
{
TurbopackResult
}
from
'./swc/types'
import
type
{
FunctionsConfigManifest
}
from
'./index'
export
type
ROUTER_TYPE
=
'pages'
|
'app'
export
type
ROUTER_TYPE
=
'pages'
|
'app'
...
@@ -274,6 +275,7 @@ export async function printTreeView(
...
@@ -274,6 +275,7 @@ export async function printTreeView(
pagesDir
,
pagesDir
,
pageExtensions
,
pageExtensions
,
middlewareManifest
,
middlewareManifest
,
functionsConfigManifest
,
useStaticPages404
,
useStaticPages404
,
hasGSPAndRevalidateZero
,
hasGSPAndRevalidateZero
,
}:
{
}:
{
...
@@ -281,6 +283,7 @@ export async function printTreeView(
...
@@ -281,6 +283,7 @@ export async function printTreeView(
pageExtensions
:
PageExtensions
pageExtensions
:
PageExtensions
buildManifest
:
BuildManifest
buildManifest
:
BuildManifest
middlewareManifest
:
MiddlewareManifest
middlewareManifest
:
MiddlewareManifest
functionsConfigManifest
:
FunctionsConfigManifest
useStaticPages404
:
boolean
useStaticPages404
:
boolean
hasGSPAndRevalidateZero
:
Set
<
string
>
hasGSPAndRevalidateZero
:
Set
<
string
>
}
}
...
@@ -533,8 +536,12 @@ export async function printTreeView(
...
@@ -533,8 +536,12 @@ export async function printTreeView(
list
:
lists
.
pages
,
list
:
lists
.
pages
,
})
})
const
middlewareInfo
=
middlewareManifest
.
middleware
?.[
'/'
]
if
(
if
(
middlewareInfo
?.
files
.
length
>
0
)
{
middlewareManifest
.
middleware
?.[
'/'
]?.
files
.
length
>
0
||
// 'nodejs' runtime middleware or proxy is set to
// functions-config-manifest instead of middleware-manifest.
functionsConfigManifest
.
functions
?.[
'/_middleware'
]
)
{
messages
.
push
([])
messages
.
push
([])
messages
.
push
([
'ƒ Proxy (Middleware)'
])
messages
.
push
([
'ƒ Proxy (Middleware)'
])
}
}
...
...
test/production/app-dir/proxy-build-cli-output/app/layout.tsx
0 → 100644
View file @
d8cde2a5
import
{
ReactNode
}
from
'react'
export
default
function
Root
({
children
}:
{
children
:
ReactNode
})
{
return
(
<
html
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/production/app-dir/proxy-build-cli-output/app/page.tsx
0 → 100644
View file @
d8cde2a5
export
default
function
Page
()
{
return
<
p
>
hello world
</
p
>
}
test/production/app-dir/proxy-build-cli-output/next.config.js
0 → 100644
View file @
d8cde2a5
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{}
module
.
exports
=
nextConfig
test/production/app-dir/proxy-build-cli-output/proxy-build-cli-output.test.ts
0 → 100644
View file @
d8cde2a5
import
{
nextTestSetup
}
from
'e2e-utils'
describe
(
'proxy-build-cli-output'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
it
(
'should print proxy in the build CLI output'
,
async
()
=>
{
expect
(
next
.
cliOutput
).
toContain
(
'ƒ Proxy (Middleware)'
)
const
browser
=
await
next
.
browser
(
'/foo'
)
expect
(
await
browser
.
elementByCss
(
'p'
).
text
()).
toBe
(
'hello world'
)
})
})
test/production/app-dir/proxy-build-cli-output/proxy.ts
0 → 100644
View file @
d8cde2a5
import
{
NextRequest
,
NextResponse
}
from
'next/server'
export
default
function
proxy
(
request
:
NextRequest
)
{
if
(
request
.
nextUrl
.
pathname
===
'/foo'
)
{
return
NextResponse
.
redirect
(
new
URL
(
'/'
,
request
.
url
))
}
return
NextResponse
.
next
()
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment