Skip to content

Commit

Permalink
Fix outdated error message in paginate() function (#6124)
Browse files Browse the repository at this point in the history
* Update paginate.ts

* Create gorgeous-mails-sniff.md
  • Loading branch information
FredKSchott authored Feb 3, 2023
1 parent 4f150e8 commit f20a85b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-mails-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fix outdated error message in `paginate()` function.
2 changes: 1 addition & 1 deletion packages/astro/src/core/render/paginate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function generatePaginateFunction(routeMatch: RouteData): PaginateFunctio
includesFirstPageNumber = true;
} else {
throw new Error(
`[paginate()] page number param \`${paramName}\` not found in your filepath.\nRename your file to \`[...page].astro\` or customize the param name via the \`paginate([], {param: '...'}\` option.`
`[paginate()] page number param \`${paramName}\` not found in your filepath.\nRename your file to \`[page].astro\` or \`[...page].astro\`.`
);
}
const lastPage = Math.max(1, Math.ceil(data.length / pageSize));
Expand Down

0 comments on commit f20a85b

Please sign in to comment.