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

Build container ran out of memory For Next js 14 app #1919

Closed
IzaanAnwar opened this issue Aug 26, 2024 · 4 comments
Closed

Build container ran out of memory For Next js 14 app #1919

IzaanAnwar opened this issue Aug 26, 2024 · 4 comments
Labels
console-builds Issues related to Amplify console builds pending-triage Incoming issues that need categorization

Comments

@IzaanAnwar
Copy link

Environment information

System:
  OS: Linux 6.9 Manjaro Linux
  CPU: (4) x64 11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz
  Memory: 2.69 GB / 7.47 GB
  Shell: /usr/bin/zsh
Binaries:
  Node: 22.2.0 - ~/.nvm/versions/node/v22.2.0/bin/node
  Yarn: 1.22.22 - /usr/bin/yarn
  npm: 10.7.0 - ~/.nvm/versions/node/v22.2.0/bin/npm
  pnpm: 9.8.0 - ~/Work/galzzy/node_modules/.bin/pnpm
NPM Packages:
  @aws-amplify/auth-construct: Not Found
  @aws-amplify/backend: 1.1.1
  @aws-amplify/backend-auth: Not Found
  @aws-amplify/backend-cli: 1.2.3
  @aws-amplify/backend-data: Not Found
  @aws-amplify/backend-deployer: Not Found
  @aws-amplify/backend-function: Not Found
  @aws-amplify/backend-output-schemas: Not Found
  @aws-amplify/backend-output-storage: Not Found
  @aws-amplify/backend-secret: Not Found
  @aws-amplify/backend-storage: Not Found
  @aws-amplify/cli-core: Not Found
  @aws-amplify/client-config: Not Found
  @aws-amplify/deployed-backend-client: Not Found
  @aws-amplify/form-generator: Not Found
  @aws-amplify/model-generator: Not Found
  @aws-amplify/platform-core: Not Found
  @aws-amplify/plugin-types: Not Found
  @aws-amplify/sandbox: Not Found
  @aws-amplify/schema-generator: Not Found
  aws-amplify: 6.5.1
  aws-cdk: 2.152.0
  aws-cdk-lib: 2.152.0
  typescript: 5.5.4
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Description

This is my amplify.yml

version: 1 backend: phases: build: commands: - corepack enable - pnpm install --frozen-lockfile - pnpm exec ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID frontend: phases: build: commands: - npx ampx info - pnpm run build artifacts: baseDirectory: .next files: - '**/*' cache: paths: - $(pnpm store path) - .next/cache/**/* - node_modules/**/*

I have tried building with npm too it does not work... It runs locally fine.. and in vercel too it is getting no error. But why am I having problem with amplify

@IzaanAnwar IzaanAnwar added the pending-triage Incoming issues that need categorization label Aug 26, 2024
@IzaanAnwar
Copy link
Author

The result of npx ampx info pasted here is of my local env not amplify image.. as the output of the image had few values that I don't want anyone to see and I was unsure I posted this

@ykethan ykethan added the console-builds Issues related to Amplify console builds label Aug 26, 2024
@Jay2113
Copy link

Jay2113 commented Aug 27, 2024

Hi @IzaanAnwar 👋 , thanks for raising this! Your build specification amplify.yml file has the following cache paths:

cache:
    paths:
        - $(pnpm store path)
        - node_modules/**/*
        - .next/cache/**/*

For pnpm specifically, can you remove the node_modules path and instead only use the pnpm store which acts as a central cache for all dependencies: https://pnpm.io/cli/store#path ?

cache:
    paths:
      - $(pnpm store path)
      - .next/cache/**/*

@Jay2113 Jay2113 added the pending-response Issue is pending response from author label Aug 27, 2024
@jayeshbhole
Copy link

I was facing a similar issue - #1944.
No luck fiddling with --max-old-space-size, fixing the cache path has worked for me though.
Looks like the docs could help a bunch mentioning this somewhere! :))

@IzaanAnwar
Copy link
Author

@Jay2113 thanks it worked

@github-actions github-actions bot removed the pending-response Issue is pending response from author label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console-builds Issues related to Amplify console builds pending-triage Incoming issues that need categorization
Projects
None yet
Development

No branches or pull requests

6 participants
@Jay2113 @jayeshbhole @ykethan @IzaanAnwar and others