Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-elicx committed May 13, 2024
1 parent 6ce25be commit 5850426
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,13 @@ function fixFunctionContents(contents: string): string {
// https://github.com/vercel/next.js/blob/9ec37c12/packages/next/src/compiled/react/cjs/react.react-server.production.js#L87
contents = contents.replace(
/([\w$]+) instanceof URL\?new Request\([\w$]+,([\w$]+)\):[\w$]+;/gm,
`(() => {
`(($1, $2) => {
if ($1 instanceof URL) {
const { cache, ...init } = $2 ?? {};
return new Request($1, init);
}
return $1;
})();`,
})($1, $2);`,
);

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

0 comments on commit 5850426

Please sign in to comment.