Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.36 KB

invalid-get-static-paths-entry.mdx

File metadata and controls

33 lines (24 loc) · 1.36 KB
title i18nReady githubURL
Invalid entry inside getStaticPath's return value
true

import DontEditWarning from '~/components/DontEditWarning.astro'

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

What went wrong?

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.

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

See Also: