Use worker.name instead of edge function name to fix type error in @vercel/next (#11050)

Uses another `name` property instead of the now deprecated one.
This commit is contained in:
Ethan Arrowood
2024-01-16 13:56:28 -07:00
committed by GitHub
parent 8b7479fb6e
commit 0716130e58
2 changed files with 7 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@vercel/next": patch
---
Use `worker.name` instead of edge function name to fix type error in `@vercel/next`

View File

@@ -2856,6 +2856,7 @@ export async function getMiddlewareBundle({
return {
type,
page: edgeFunction.page,
name: edgeFunction.name,
edgeFunction: (() => {
const { source, map } = wrappedModuleSource.sourceAndMap();
const transformedMap = stringifySourceMap(
@@ -2951,8 +2952,7 @@ export async function getMiddlewareBundle({
};
for (const worker of workerConfigs.values()) {
const edgeFile = worker.edgeFunction.name;
let shortPath = edgeFile;
let shortPath = worker.name;
// Replacing the folder prefix for the page
//