Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error serializing .stars returned from getStaticProps in "/". #15

Closed
xPolar opened this issue Sep 23, 2022 · 1 comment
Closed

Error serializing .stars returned from getStaticProps in "/". #15

xPolar opened this issue Sep 23, 2022 · 1 comment

Comments

@xPolar
Copy link

xPolar commented Sep 23, 2022

Getting this error after trying to deploy to Vercel.

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
--
19:56:08.857 | Error: Error serializing `.stars` returned from `getStaticProps` in "/".
19:56:08.857 | Reason: `undefined` cannot be serialized as JSON. Please use `null` or omit this value.
19:56:08.857 | at isSerializable (/vercel/path0/node_modules/next/dist/lib/is-serializable-props.js:36:19)
19:56:08.857 | at /vercel/path0/node_modules/next/dist/lib/is-serializable-props.js:43:66
19:56:08.858 | at Array.every (<anonymous>)
19:56:08.858 | at isSerializable (/vercel/path0/node_modules/next/dist/lib/is-serializable-props.js:40:39)
19:56:08.859 | at Object.isSerializableProps (/vercel/path0/node_modules/next/dist/lib/is-serializable-props.js:63:12)
19:56:08.859 | at renderToHTML (/vercel/path0/node_modules/next/dist/server/render.js:441:93)
19:56:08.859 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
19:56:08.859 | at async /vercel/path0/node_modules/next/dist/export/worker.js:304:36
19:56:08.859 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
19:56:08.860 |  
19:56:08.860 | > Build error occurred
19:56:08.860 | info  - Generating static pages (16/16)
19:56:08.863 | Error: Export encountered errors on following paths:
19:56:08.863 | /
19:56:08.863 | at /vercel/path0/node_modules/next/dist/export/index.js:404:19
19:56:08.863 | at runMicrotasks (<anonymous>)
19:56:08.864 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
19:56:08.864 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
19:56:08.864 | at async /vercel/path0/node_modules/next/dist/build/index.js:1229:21
19:56:08.864 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
19:56:08.864 | at async /vercel/path0/node_modules/next/dist/build/index.js:1091:17
19:56:08.865 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
19:56:08.865 | at async Object.build [as default] (/vercel/path0/node_modules/next/dist/build/index.js:65:29)
19:56:08.905 | error Command failed with exit code 1.
19:56:08.905 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
19:56:08.912 | Error: Command "yarn run build" exited with 1
@steven-tey
Copy link
Collaborator

Whoops, this is a silly mistake on my end (I should've accounted for the case where you don't have the GITHUB_OAUTH_TOKEN env var set. Feel free to set stars to 0 or something!

This PR should fix it: #16

Also added some self-hosted setup instructions in the .env.example file (it's not perfect yet but it's a start)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants