Getting build error when trying to deploy
PopeOnARope opened this issue · comments
Getting the following build error when trying to build my app locally. same error when trying to deploy to vercel. Any advice would be greatly appreciated!
info - Generating static pages (38/38)
> Build error occurred
Error: Export encountered errors on following paths:
/en-US/collection/men
/en-US/collection/spring
/en-US/collection/womens
at project/node_modules/next/dist/export/index.js:31:1106
at async Span.traceAsyncFn (project/node_modules/next/dist/telemetry/trace/trace.js:5:584)
at async project/node_modules/next/dist/build/index.js:43:49
at async Span.traceAsyncFn (project/node_modules/next/dist/telemetry/trace/trace.js:5:584)
at async project/node_modules/next/dist/build/index.js:25:1475
at async Span.traceAsyncFn (project/node_modules/next/dist/telemetry/trace/trace.js:5:584)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nextjs-commerce@1.0.0 build: `next build`
npm ERR! Exit status 1
Ok, So I figured this one out, or at least figured out a workaround.
By adding collections by the name ‘men’ ‘spring’ and ‘womens’ to my store, it fixes this build issue. I could not for the life of me figure out where i was still trying to fetch from those collections however, so some help with that would still be appreciated! Also curious if this is a common issue
@PopeOnARope those collections are demo store collections, make sure you updated your env file with the correct API keys, specifically your newly created builder's space keys
also if this only happens on deploy, I'd double check the env variables in your .env.production file