(edited)
When using Optional Catch-all Segments and building the app, the following error occurs:
Error occurred prerendering page "/docs/[[...slug]]". Read more: https://nextjs.org/docs/messages/prerender-errorExport encountered an error on /(docs)/docs/[[...slug]]/page: /docs/[[...slug]], exiting the build.But without the optional segments, there is no error.
src/app/docs/[[...slug]]/page.tsx
"use cache";
export default async function Page() { return <div>Docs</div>;}