I am using AWS Amplify to host my NextJS app last 6 months and everything has worked fine until last night, from last night I started to get this error message during the build (!!! CustomerError: The size of the build output (730117307) exceeds the max allowed size of230686720 bytes. Please reduce the size ofyour build output and try again.)
How is this possible because we haven’t done any big change in our app we have changed just text and also I would like to note that we have tried to rebuild even the latest successful build from AWS Amplify but also that one failed.
I am using NextJS 14.2.3 and NodeJS 20.13.0
LOGS:
## Completed Frontend Build
2024-05-19T12:14:57.541Z [INFO]: ## Build completed successfully
2024-05-19T12:14:57.543Z [INFO]: # Starting caching...
2024-05-19T12:14:57.552Z [INFO]: # Creating cache artifact...
2024-05-19T12:15:40.495Z [INFO]: # Created cache artifact
2024-05-19T12:15:40.570Z [INFO]: # Uploading cache artifact...
2024-05-19T12:15:44.814Z [INFO]: # Uploaded cache artifact
2024-05-19T12:15:44.925Z [INFO]: # Caching completed
2024-05-19T12:16:26.140Z [ERROR]: !!! CustomerError: The size of the build output (730117307) exceeds the max allowed size of230686720 bytes. Please reduce the size ofyour build output and try again.
2024-05-19T12:16:26.209Z [INFO]: # Starting environment caching...
2024-05-19T12:16:26.210Z [INFO]: # Environment caching completed
AMPLIFY.yml
version: 1
frontend:
phases:
preBuild:
commands:
- rm yarn.lock
- rm -rf .next
- rm -rf node_modules
- yarn install
build:
commands:
- echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
- echo "NEXTAUTH_SECRET=$NEXTAUTH_SECRET" >> .env
- echo "APPLE_CLIENT_ID=$APPLE_CLIENT_ID" >> .env
- echo "APPLE_SECRET=$APPLE_SECRET" >> .env
- echo "GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID" >> .env
- echo "GOOGLE_CLIENT_SECRET_ID=$GOOGLE_CLIENT_SECRET_ID" >> .env
- yarn run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*