跳到內容

Invalid entry inside getStaticPaths()'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 arrays 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:

貢獻 社群 贊助