[next] fix lambda creation for i18n edge pages (#10630)

An issue similar to https://github.com/vercel/next.js/issues/44381
exists whereby vercel creates lambda functions for edge pages when i18n
is configured.

Fixes https://github.com/vercel/next.js/issues/42854

---------

Co-authored-by: Steven <steven@ceriously.com>
This commit is contained in:
Csaba Palfi
2023-10-02 23:57:50 +01:00
committed by GitHub
parent 09f1bbfa41
commit a18ed98f2d
8 changed files with 131 additions and 0 deletions

View File

@@ -2572,6 +2572,11 @@ export function normalizeEdgeFunctionPath(
shortPath = 'index';
}
}
if (shortPath.startsWith('pages/')) {
shortPath = shortPath.replace(/^pages\//, '');
}
return shortPath;
}