Skip to content

Commit 0716130

Browse files
author
Ethan Arrowood
authoredJan 16, 2024
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.
1 parent 8b7479f commit 0716130

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎.changeset/rich-lemons-matter.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vercel/next": patch
3+
---
4+
5+
Use `worker.name` instead of edge function name to fix type error in `@vercel/next`

‎packages/next/src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2856,6 +2856,7 @@ export async function getMiddlewareBundle({
28562856
return {
28572857
type,
28582858
page: edgeFunction.page,
2859+
name: edgeFunction.name,
28592860
edgeFunction: (() => {
28602861
const { source, map } = wrappedModuleSource.sourceAndMap();
28612862
const transformedMap = stringifySourceMap(
@@ -2951,8 +2952,7 @@ export async function getMiddlewareBundle({
29512952
};
29522953

29532954
for (const worker of workerConfigs.values()) {
2954-
const edgeFile = worker.edgeFunction.name;
2955-
let shortPath = edgeFile;
2955+
let shortPath = worker.name;
29562956

29572957
// Replacing the folder prefix for the page
29582958
//

0 commit comments

Comments
 (0)
Please sign in to comment.