Start from this ZIP file.
designsystembuttons was imported from a ZIP file. Continue chatting to ask questions about or make changes to it.
An error occurred during deployment. Please fix:
Error occurred prerendering page "/design-system". Read more: https://nextjs.org/docs/messages/prerender-error
Error: React.Children.only expected to receive a single React element child.
at Object.only (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:124:4022)
at /vercel/path0/.next/server/chunks/150.js:2:5372
at nL (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:46773)
at nF (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:63717)
at nq (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:67434)
at nH (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:65009)
at nU (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:47125)
at nF (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:63740)
at nF (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:64360)
at nq (/vercel/path0/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:67434)
Export encountered an error on /design-system/page: /design-system, exiting the build.
⨯ Next.js build worker exited with code: 1 and signal: null
ELIFECYCLE Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
I'll fix the error in the design system page. The issue is with the Button
components that have the asChild
prop. When using asChild
, the component expects exactly one child element.
I've fixed the error by removing the asChild
prop from all the Button
components in the design system page.
The issue was that when using the asChild
prop with the Button
component, it expects exactly one child element. The error message "React.Children.only expected to receive a single React element child" indicates that there was a problem with how the children were being passed to a component that uses React.Children.only()
.
Now the Button
components will render normally with the Link
components as their children, which should resolve the deployment error.
An error occurred during deployment. Please fix:
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Error: React.Children.only expected to receive a single React element child.
at Object.only (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:124:4022)
at /vercel/path1/.next/server/chunks/502.js:17:53540
at nL (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:46773)
at nF (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:63717)
at nq (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:67434)
at nH (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:65009)
at nU (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:47125)
at nF (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:63740)
at nF (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:64360)
at nq (/vercel/path1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:76:67434)
Export encountered an error on /page: /, exiting the build.
⨯ Next.js build worker exited with code: 1 and signal: null
error: script "build" exited with code 1
Error: Command "bun run build" exited with 1