Skip to content

Commit 9fac077

Browse files
authored
fix: metadata image route normalize path posix for windows (vercel#71673)
### Why? When handling the opengraph-image size exceeding the limit, we mapped with string literal between Rust and JavaScript. The Rust string literal contains backslashes `\` on Windows, incompatible with JavaScript string syntax. Following up on vercel#71615. Fixes vercel#71582
1 parent c1cfee3 commit 9fac077

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ async function getStaticAssetRouteCode(
7676
resourcePath: string,
7777
fileBaseName: string
7878
) {
79+
resourcePath = path.posix.normalize(resourcePath)
80+
7981
const cache =
8082
fileBaseName === 'favicon'
8183
? 'public, max-age=0, must-revalidate'

0 commit comments

Comments
 (0)