预渲染的动态端点存在路径冲突。
PrerenderDynamicEndpointPathCollide:无法使用
undefined
参数渲染PATHNAME
,因为生成的路径将在预渲染期间发生冲突。防止将undefined
作为params
传递给端点的getStaticPaths()
功能,或向端点的文件名添加额外的扩展名。¥PrerenderDynamicEndpointPathCollide: Could not render
PATHNAME
with anundefined
param as the generated path will collide during prerendering. Prevent passingundefined
asparams
for the endpoint’sgetStaticPaths()
function, or add an additional extension to the endpoint’s filename.
什么地方出了错?
Section titled 什么地方出了错?¥What went wrong?
端点使用 undefined
参数进行预渲染,因此生成的路径将与另一条路由发生冲突。
¥The endpoint is prerendered with an undefined
param so the generated path will collide with another route.
如果无法阻止传递 undefined
,则可以在端点文件名中添加额外的扩展名,以生成具有不同名称的文件。例如,将 pages/api/[slug].ts
重命名为 pages/api/[slug].json.ts
。
¥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:
Error Reference