diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 94c67e04faf5c..42b1ef934005b 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -2059,10 +2059,8 @@ export default async function build( formatManifest(requiredServerFiles) ) - const middlewareManifest: MiddlewareManifest = JSON.parse( - await readFileUtf8( - path.join(distDir, SERVER_DIRECTORY, MIDDLEWARE_MANIFEST) - ) + const middlewareManifest: MiddlewareManifest = await readManifest( + path.join(distDir, SERVER_DIRECTORY, MIDDLEWARE_MANIFEST) ) const finalPrerenderRoutes: { [route: string]: SsgRoute } = {}