Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/astro/src/core/render/route-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export async function callGetStaticPaths({
// Add a check here to make TypeScript happy.
// This is already checked in validateDynamicRouteModule().
if (!mod.getStaticPaths) {
throw new Error('Unexpected Error.');
throw new Error(
`Unexpected error: the module for route "${route.route}" (component: ${route.component}) does not export a getStaticPaths function. ` +
`This route expects static paths but the module has no getStaticPaths() export. ` +
`Ensure ${route.component} defines and exports a getStaticPaths() function.`
);
}

// Calculate your static paths.
Expand Down
Loading