Next Build Stops After Type Validations

I have a dokku deployment set up which when running, no longer successfully builds my app. The logs outputted are the following:
-----> Build
Running build (yarn)
yarn run v1.22.19
$ next build
info - Loaded env from /tmp/build/.env
warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info - Linting and checking validity of types...
Done in 98.61s.

-----> Build
Running build (yarn)
yarn run v1.22.19
$ next build
info - Loaded env from /tmp/build/.env
warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info - Linting and checking validity of types...
Done in 98.61s.

and you can see that it does not output the actual building and optimisation steps, e.g.:
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
info - Generating static pages (12/12)
info - Finalizing page optimization
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
info - Generating static pages (12/12)
info - Finalizing page optimization
Running the build locally works fine, and deploying the previous working commit still works as expected.
1 Reply
ed.upton
ed.upton16mo ago
After many hours debugging, I've found the cause and the solution: It seems that the aws-sdk NPM package is breaking deployment silently somehow, with a potential similar/equivalent problem mentioned in this post https://stackoverflow.com/questions/75107933/aws-sdk-contributes-to-build-error-uncaught-typeerror-e-is-not-a-constructor. The solution is to move to v3 of the JavaScript AWS SDK (https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html), which I have confirmed does not have the same issue when building.