تخطَّ إلى المحتوى
This is an unmaintained snapshot of the Astro v4 docs. View the latest docs.

Invalid entry inside getStaticPath's return value

هذا المحتوى غير متوفر بلغتك بعد.

InvalidGetStaticPathsEntry: Invalid entry returned by getStaticPaths. Expected an object, got ENTRY_TYPE

getStaticPaths’s return value must be an array of objects. In most cases, this error happens because an array of array was returned. Using .flatMap() or a .flat() call may be useful.

pages/blog/[id].astro
export async function getStaticPaths() {
return [ // <-- Array
{ params: { slug: "blog" } }, // <-- Object
{ params: { slug: "about" } }
];
}

See Also:

ساهم

بماذا تفكّر؟

المجتمع