Question

Deploying NodeJS app using Yarn Workspaces: "Build Error: Out of Memory"

Hey there! Trying to deploy a nodejs server using the Digital Ocean App Platform. This server sits in a yarn workspaces monorepo.

My app spec looks like this here:

alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
envs:
 // ...
name: foo
region: fra
services:
- build_command: yarn workspace server build
  environment_slug: node-js
  github:
    branch: test
    deploy_on_push: true
    repo: foo/bar
  http_port: 8080
  instance_count: 1
  instance_size_slug: basic-xxs
  log_destinations:
  - logtail:
      token: ****
    name: Logtail
  name: foo
  routes:
  - path: /
  run_command: yarn workspace server start
  source_dir: /

build seems to be working just fine according to the logs. But after the build it’s getting stuck on Adding layer 'heroku/nodejs-engine:yarn' (at least this is the last log entry).

[2022-02-16 13:16:56] Running custom build command: yarn workspace server build
[2022-02-16 13:16:57] yarn workspace v1.22.17
[2022-02-16 13:16:57] yarn run v1.22.17
[2022-02-16 13:16:58] $ tsc
[2022-02-16 13:17:02] Done in 4.62s.
[2022-02-16 13:17:02] Done in 5.38s.
[2022-02-16 13:17:53] 
[2022-02-16 13:17:53] => Uploading the built Docker image to the container registry...
[2022-02-16 13:18:05] Adding layer 'heroku/nodejs-engine:nodejs'
[2022-02-16 13:18:07] Adding layer 'heroku/nodejs-engine:yarn'
[]

after that Digital Oceans GUI says Build Error: Out of Memory. So I went ahead and increased memory from 512MB to 4GB, no changes.

Any ideas? I get the feeling it could be related to the yarn workspaces here.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hey @marcmintel,

What I could suggest is trying to rebuild the application. If even the rebuild is failing, I could suggest choosing a larger component with more memory as a test.

If both do not help, please reach out to our amazing support team who will be more than happy to assist you with your issue! :)

https://www.digitalocean.com/support/

Hope that helps!

- Bobby.