Skip to content

Commit

Permalink
Fix middleware at root in standalone mode
Browse files Browse the repository at this point in the history
  • Loading branch information
skirsten committed Jan 6, 2022
1 parent 52d5adf commit 44f0c57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ export async function copyTracedFiles(
for (const page of pageKeys) {
if (MIDDLEWARE_ROUTE.test(page)) {
const { files } =
middlewareManifest.middleware[page.replace(/\/_middleware$/, '')]
middlewareManifest.middleware[page.replace(/\/_middleware$/, '') || '/']

for (const file of files) {
const originalPath = path.join(distDir, file)
Expand Down

0 comments on commit 44f0c57

Please sign in to comment.