Skip to content

Commit 5d65889

Browse files
committed
fixup
1 parent be00947 commit 5d65889

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

crates/next-core/src/middleware.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ pub async fn get_middleware_module(
9191
let source = load_next_js_template(
9292
"middleware.js",
9393
project_root,
94-
&[
95-
("VAR_USERLAND", INNER),
96-
("VAR_DEFINITION_PAGE", page_path),
97-
("VAR_MODULE_RELATIVE_PATH", userland_path.path.as_str()),
98-
],
94+
&[("VAR_USERLAND", INNER), ("VAR_DEFINITION_PAGE", page_path)],
9995
&[],
10096
&[],
10197
)

packages/next/src/build/entries.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545
isMiddlewareFilename,
4646
isInstrumentationHookFile,
4747
isInstrumentationHookFilename,
48+
isProxyFilename,
4849
} from './utils'
4950
import { getPageStaticInfo } from './analysis/get-page-static-info'
5051
import { normalizePathSep } from '../shared/lib/page-path/normalize-path-sep'
@@ -766,6 +767,11 @@ export function runDependingOnPageType<T>(params: {
766767
return
767768
}
768769

770+
if (isProxyFilename(params.page)) {
771+
params.onServer()
772+
return
773+
}
774+
769775
if (isMiddlewareFile(params.page)) {
770776
if (params.pageRuntime === 'nodejs') {
771777
params.onServer()

packages/next/src/build/webpack/loaders/next-middleware-loader.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,5 @@ export default async function middlewareLoader(this: any) {
7070
return await loadEntrypoint('middleware', {
7171
VAR_USERLAND: pagePath,
7272
VAR_DEFINITION_PAGE: page,
73-
// Turbopack sets `VAR_USERLAND` to `INNER_MIDDLEWARE_MODULE`, so use
74-
// `VAR_MODULE_RELATIVE_PATH` for error messages.
75-
VAR_MODULE_RELATIVE_PATH: pagePath,
7673
})
7774
}

0 commit comments

Comments
 (0)