Skip to content

Commit bfdf527

Browse files
authored
fix: webpack build error on Windows (#71943)
1 parent ba9879b commit bfdf527

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ async function getStaticAssetRouteCode(
7676
resourcePath: string,
7777
fileBaseName: string
7878
) {
79-
resourcePath = path.posix.normalize(resourcePath)
80-
8179
const cache =
8280
fileBaseName === 'favicon'
8381
? 'public, max-age=0, must-revalidate'
@@ -107,7 +105,7 @@ const buffer = Buffer.from(${JSON.stringify(
107105
if (${isTwitter || isOpenGraph}) {
108106
const fileSizeInMB = buffer.byteLength / 1024 / 1024
109107
if (fileSizeInMB > ${fileSizeLimit}) {
110-
throw new Error('File size for ${imgName} image "${resourcePath}" exceeds ${fileSizeLimit}MB. ' +
108+
throw new Error('File size for ${imgName} image ${JSON.stringify(resourcePath)} exceeds ${fileSizeLimit}MB. ' +
111109
\`(Current: \${fileSizeInMB.toFixed(2)}MB)\n\` +
112110
'Read more: https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image#image-files-jpg-png-gif'
113111
)

0 commit comments

Comments
 (0)