Skip to content

Commit

Permalink
tweak wording, update links
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Jan 10, 2025
1 parent 8ac924b commit c89b032
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/kit/src/core/config/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const options = object(
(/** @type {any} */ { message }) => {
throw new Error(
message +
'\nTo suppress or handle this error, implement `handleNotPrerenderedRoutes` in https://kit.svelte.dev/docs/configuration#prerender'
'\nTo suppress or handle this error, implement `handleNotPrerenderedRoutes` in https://svelte.dev/docs/kit/configuration#prerender'
);
},
(input, keypath) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/kit/src/core/postbuild/prerender.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {
const handle_not_prerendered_route = normalise_error_handler(
log,
config.prerender.handleNotPrerenderedRoutes,
({ notPrerenderedRoutes }) => {
const list = notPrerenderedRoutes.map((id) => ` - ${id}`).join('\n');
({ routes }) => {
const list = routes.map((id) => ` - ${id}`).join('\n');
return `The following routes were marked as prerenderable, but were not prerendered because they were not found while crawling your app:\n${list}\n\nSee https://svelte.dev/docs/kit/page-options#prerender-troubleshooting for info on how to solve this`;
}
);
Expand Down Expand Up @@ -535,7 +535,7 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {
}

if (not_prerendered.length > 0) {
handle_not_prerendered_route({ notPrerenderedRoutes: not_prerendered });
handle_not_prerendered_route({ routes: not_prerendered });
}

return { prerendered, prerender_map };
Expand Down
5 changes: 4 additions & 1 deletion packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,10 @@ export interface KitConfig {
* - `'fail'` — fail the build
* - `'ignore'` - silently ignore the failure and continue
* - `'warn'` — continue, but print a warning
* - `(details) => void` — a custom error handler that takes a `details` object with `notPrerenderedRoutes` property. If you `throw` from this function, the build will fail
* - `(details) => void` — a custom error handler that takes a `details` object with a `routes` property which contains all routes that haven't been prerendered. If you `throw` from this function, the build will fail
*
* The default behavior is to fail the build. This may be undesireable when you know that some of your routes may never be reached under certain
* circumstances such as a CMS not returning data for a specific area, resulting in the certain routes never being reached.
*
* @default "fail"
* @since 2.5.0
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/types/private.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export interface PrerenderEntryGeneratorMismatchHandler {
}

export interface PrerenderEntryMissingRoutesHandler {
(details: { notPrerenderedRoutes: string[]; message: string }): void;
(details: { routes: string[]; message: string }): void;
}

export type PrerenderHttpErrorHandlerValue = 'fail' | 'warn' | 'ignore' | PrerenderHttpErrorHandler;
Expand Down
5 changes: 4 additions & 1 deletion packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,10 @@ declare module '@sveltejs/kit' {
* - `'fail'` — fail the build
* - `'ignore'` - silently ignore the failure and continue
* - `'warn'` — continue, but print a warning
* - `(details) => void` — a custom error handler that takes a `details` object with `notPrerenderedRoutes` property. If you `throw` from this function, the build will fail
* - `(details) => void` — a custom error handler that takes a `details` object with a `routes` property which contains all routes that haven't been prerendered. If you `throw` from this function, the build will fail
*
* The default behavior is to fail the build. This may be undesireable when you know that some of your routes may never be reached under certain
* circumstances such as a CMS not returning data for a specific area, resulting in the resulting routes never being reached.
*
* @default "fail"
* @since 2.5.0
Expand Down

0 comments on commit c89b032

Please sign in to comment.