chen-rn / CUA

(deprecateed) create-universal-app(CUA) is an opinionated template for creating fullstack universal apps (Expo, Next, tRPC, Prisma, Clerk, Solito, Tamagui)
https://cua-demo.vercel.app
MIT License
1.01k stars 67 forks source link

[BUG] Clerk pageProps doesn't allow builds on vercel to work properly #59

Closed jasonnoahchoi closed 1 year ago

jasonnoahchoi commented 1 year ago

Describe the bug I haven't investigated too much about why this is happening, but no matter what I was doing, the project runs fine locally, but I just couldn't get builds to work on vercel or if I run yarn build.

To Reproduce Steps to reproduce the behavior:

  1. Pull down a fresh template/clone/project
  2. yarn
  3. setup postgres, clerk, etc and connect all ENV vars
  4. yarn build OR deploy to vercel
  5. check localhost:3000 or vercel, you'll get an internal error
  6. Undo code written in PR #51 done by @roguealexander
  7. It works

Expected behavior A clear and concise description of what you expected to happen. I expect the page to render without an internal server error

Screenshots If applicable, add screenshots to help explain your problem. I believe the demo project is likely the same. I'm sure if you undo PR #51 cua-demo.vercel.app will render again.

Desktop (please complete the following information):

Smartphone (please complete the following information):

AtlantisPleb commented 1 year ago

Came here to make an issue for the following, but looks related to this - something wrong with Clerk getServerSideProps on the homepage?

On a fresh CUA via npx create-t3-universal-app, after setting up env variables, running yarn desktop fails with "pages with getServerSideProps can not be exported":

nextjs:dev:tauri: Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
nextjs:dev:tauri: Error: Error for page /: pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export
nextjs:dev:tauri:     at /Users/{...}/node_modules/next/dist/export/worker.js:245:23
nextjs:dev:tauri:     at async Span.traceAsyncFn (/Users/{...}/node_modules/next/dist/trace/trace.js:79:20)
nextjs:dev:tauri: info  - Exporting (8/8)
nextjs:dev:tauri: Error: Export encountered errors on following paths:
nextjs:dev:tauri:       /
nextjs:dev:tauri:     at /Users/{...}/node_modules/next/dist/export/index.js:409:19
nextjs:dev:tauri:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
nextjs:dev:tauri:     at async Span.traceAsyncFn (/Users/{...}/next/dist/trace/trace.js:79:20)
nextjs:dev:tauri:        Error The "beforeDevCommand" terminated with a non-zero status code.
chen-rn commented 1 year ago

I'm not too sure why getServerSideProps is breaking it in this case, if someone can make it work I'd love a PR! But for now I've reverted the PR that causes the issue!

albbus-stack commented 1 year ago

Came here to make an issue for the following, but looks related to this - something wrong with Clerk getServerSideProps on the homepage?

On a fresh CUA via npx create-t3-universal-app, after setting up env variables, running yarn desktop fails with "pages with getServerSideProps can not be exported":

nextjs:dev:tauri: Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
nextjs:dev:tauri: Error: Error for page /: pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export
nextjs:dev:tauri:     at /Users/{...}/node_modules/next/dist/export/worker.js:245:23
nextjs:dev:tauri:     at async Span.traceAsyncFn (/Users/{...}/node_modules/next/dist/trace/trace.js:79:20)
nextjs:dev:tauri: info  - Exporting (8/8)
nextjs:dev:tauri: Error: Export encountered errors on following paths:
nextjs:dev:tauri:       /
nextjs:dev:tauri:     at /Users/{...}/node_modules/next/dist/export/index.js:409:19
nextjs:dev:tauri:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
nextjs:dev:tauri:     at async Span.traceAsyncFn (/Users/{...}/next/dist/trace/trace.js:79:20)
nextjs:dev:tauri:        Error The "beforeDevCommand" terminated with a non-zero status code.

I believe this is due to this commit. We should probably revert it since tauri doesn't support ssr. Try without any getServerSideProps in your codebase.

albbus-stack commented 1 year ago

I believe this issue is fixed by #61, reverting #51.