diff --git a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts index 7195ffffebe7..878e41e3535a 100644 --- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts +++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts @@ -265,7 +265,7 @@ export async function generateLookupMap({ collection, slug, lookupMap[collection]!.entries[slug], - rootRelativePath(root, filePath), + rootRelativePath(root, filePath) ), hint: slug !== generatedSlug diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 9e767e659837..ac0f21026fa3 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -1293,11 +1293,13 @@ export const DuplicateContentEntrySlugError = { name: 'DuplicateContentEntrySlugError', title: 'Duplicate content entry slug.', message: (collection: string, slug: string, preExisting: string, alsoFound: string) => { - return `**${collection}** contains multiple entries with the same slug: \`${slug}\`. ` + + return ( + `**${collection}** contains multiple entries with the same slug: \`${slug}\`. ` + `Slugs must be unique.\n\n` + `Entries: \n` + `- ${preExisting}\n` + - `- ${alsoFound}`; + `- ${alsoFound}` + ); }, } satisfies ErrorData; diff --git a/packages/astro/src/runtime/server/endpoint.ts b/packages/astro/src/runtime/server/endpoint.ts index c1448affade8..bb8d64b5ba71 100644 --- a/packages/astro/src/runtime/server/endpoint.ts +++ b/packages/astro/src/runtime/server/endpoint.ts @@ -16,7 +16,7 @@ export async function renderEndpoint( const handler = mod[method] ?? mod['ALL']; if (!ssr && ssr === false && method !== 'GET') { logger.warn( - "router", + 'router', `${url.pathname} ${bold( method )} requests are not available for a static site. Update your config to \`output: 'server'\` or \`output: 'hybrid'\` to enable.` @@ -26,8 +26,12 @@ export async function renderEndpoint( logger.warn( 'router', `No API Route handler exists for the method "${method}" for the route ${url.pathname}.\n` + - `Found handlers: ${Object.keys(mod).map(exp => JSON.stringify(exp)).join(', ')}\n` + - ('all' in mod ? `One of the exported handlers is "all" (lowercase), did you mean to export 'ALL'?\n` : '') + `Found handlers: ${Object.keys(mod) + .map((exp) => JSON.stringify(exp)) + .join(', ')}\n` + + ('all' in mod + ? `One of the exported handlers is "all" (lowercase), did you mean to export 'ALL'?\n` + : '') ); // No handler found, so this should be a 404. Using a custom header // to signal to the renderer that this is an internal 404 that should