ndimatteo / HULL

💀 Headless Shopify Starter – powered by Next.js + Sanity.io
https://hull.dev
MIT License
1.36k stars 167 forks source link

Build error when generating static pages on Vercel #96

Closed 1903-development-team closed 2 years ago

1903-development-team commented 2 years ago

Hopefully this issue is just complete ignorance on our end... When we publish a production (or any build) via Github (or the Sanity app) to Vercel, we receive errors on many pages that read:

Error occurred prerendering page "/path"

then the fast follower is

ServerError: POST-request to https://xxxxxxxx.apicdn.sanity.io/v2021-03-25/data/query/production resulted in HTTP 502 Bad Gateway

The final error displayed for each path is:

at onResponse (/vercel/path1/node_modules/@sanity/client/lib/http/request.js:26:13) at applyMiddleware (/vercel/path1/node_modules/get-it/lib-node/util/middlewareReducer.js:10:15) at onResponse (/vercel/path1/node_modules/get-it/lib-node/index.js:80:22) at /vercel/path1/node_modules/get-it/lib-node/index.js:50:55 at callback (/vercel/path1/node_modules/get-it/lib-node/request/node-request.js:67:46) at /vercel/path1/node_modules/get-it/lib-node/request/node-request.js:156:14 at DestroyableTransform.<anonymous> (/vercel/path1/node_modules/simple-concat/index.js:8:13) at Object.onceWrapper (events.js:519:28) at DestroyableTransform.emit (events.js:412:35) at endReadableNT (/vercel/path1/node_modules/readable-stream/lib/_stream_readable.js:1010:12)

What's odd is the more we click 'Redeploy' in Vercel, the errors decrease and eventually, the site publishes. That doesn't seem like the right thing to do... :/ Any thoughts would be appreciated.

Thx for setting up an excellent starter!

ndimatteo commented 2 years ago

Hey there @1903-development-team!

I haven't seen this before, but based on the error you shared it sounds like the Sanity JS client is running into an issue making POST requests to your project dataset.

This doesn't appear to be an issue with your setup in HULL, so I'd suggest reaching out in their community slack to gain insight into what might be going on with your project's API usage.

1903-development-team commented 2 years ago

Thx @ndimatteo

Hull has been an excellent starting point for several projects!

We did move away from the Buy SDK on a recent project and moved over to Cart workflow so we can work with subscription products. The team is cleaning up the code and will share w/ you.

ndimatteo commented 2 years ago

@1903-development-team thanks so much! And that sounds awesome, excited to see what you came up with for the Cart workflow! Would love to move away from the Buy SDK for hull as well 🤘