From e5200fdb6c73fc404eff05e67656a46bc1b73fa5 Mon Sep 17 00:00:00 2001 From: Camille Barneaud <1693643+gadcam@users.noreply.github.com> Date: Tue, 29 Oct 2024 00:14:30 +0100 Subject: [PATCH] Fix missing `await` of `params` when metadata is used with an image file (#71871) --- .../src/build/webpack/loaders/next-metadata-image-loader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/src/build/webpack/loaders/next-metadata-image-loader.ts b/packages/next/src/build/webpack/loaders/next-metadata-image-loader.ts index 9ea90f598ab10..1f12339357d0c 100644 --- a/packages/next/src/build/webpack/loaders/next-metadata-image-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-metadata-image-loader.ts @@ -168,11 +168,11 @@ async function nextMetadataImageLoader( return `\ import { fillMetadataSegment } from 'next/dist/lib/metadata/get-metadata-route' - export default (props) => { + export default async (props) => { const imageData = ${JSON.stringify(imageData)} const imageUrl = fillMetadataSegment(${JSON.stringify( pathnamePrefix - )}, props.params, ${JSON.stringify(pageSegment)}) + )}, await props.params, ${JSON.stringify(pageSegment)}) return [{ ...imageData,