Skip to content

Commit 2e5bcb1

Browse files
committed
.
1 parent 193af30 commit 2e5bcb1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/next-on-pages/src/buildApplication/processVercelFunctions/dedupeEdgeFunctions.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,13 @@ function fixFunctionContents(contents: string): string {
503503
// https://github.com/vercel/next.js/blob/9ec37c12/packages/next/src/compiled/react/cjs/react.react-server.production.js#L87
504504
contents = contents.replace(
505505
/([\w$]+) instanceof URL\?new Request\([\w$]+,([\w$]+)\):[\w$]+;/gm,
506-
`(() => {
507-
if ($1 instanceof URL) {
508-
const { cache, ...init } = $2 ?? {};
509-
return new Request($1, init);
506+
`((rawUrl, rawInit) => {
507+
if (rawUrl instanceof URL) {
508+
const { cache, ...init } = rawInit ?? {};
509+
return new Request(rawUrl, init);
510510
}
511-
return $1;
512-
})();`,
511+
return rawUrl;
512+
})($1, $2);`,
513513
);
514514

515515
// TODO: Remove once https://github.com/vercel/next.js/issues/58265 is fixed.

0 commit comments

Comments
 (0)