Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.39 KB

prerender-dynamic-endpoint-path-collide.mdx

File metadata and controls

27 lines (18 loc) · 1.39 KB
title Prerendered dynamic endpoint has path collision.
i18nReady true
githubURL https://github.com/withastro/astro/blob/main/packages/runtime/src/internal/core/errors/errors-data.ts

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

PrerenderDynamicEndpointPathCollide: Could not render PATHNAME with an undefined param as the generated path will collide during prerendering. Prevent passing undefined as params for the endpoint's getStaticPaths() function, or add an additional extension to the endpoint's filename.

What went wrong?

The endpoint is prerendered with an undefined param so the generated path will collide with another route.

If you cannot prevent passing undefined, then an additional extension can be added to the endpoint file name to generate the file with a different name. For example, renaming pages/api/[slug].ts to pages/api/[slug].json.ts.

See Also: