Unverified Commit e5200fdb authored by Camille Barneaud's avatar Camille Barneaud Committed by GitHub

Fix missing `await` of `params` when metadata is used with an image file (#71871)

parent c376f391
...@@ -168,11 +168,11 @@ async function nextMetadataImageLoader( ...@@ -168,11 +168,11 @@ async function nextMetadataImageLoader(
return `\ return `\
import { fillMetadataSegment } from 'next/dist/lib/metadata/get-metadata-route' import { fillMetadataSegment } from 'next/dist/lib/metadata/get-metadata-route'
export default (props) => { export default async (props) => {
const imageData = ${JSON.stringify(imageData)} const imageData = ${JSON.stringify(imageData)}
const imageUrl = fillMetadataSegment(${JSON.stringify( const imageUrl = fillMetadataSegment(${JSON.stringify(
pathnamePrefix pathnamePrefix
)}, props.params, ${JSON.stringify(pageSegment)}) )}, await props.params, ${JSON.stringify(pageSegment)})
return [{ return [{
...imageData, ...imageData,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment