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.

Subscribe
Share

Okay, now my app seems to be definitely stuck in the same predicament. I’m also using yarn workspaces, so I share your suspicion. Did you manage to find a way to work around it?

Okay, now my app seems to be definitely stuck in the same predicament. I’m also using yarn workspaces, so I share your suspicion. Did you manage to find a way to work around it?

I have encountered the same issue using yarn workspaces. However, once I reran the deployment I didn’t see it again…


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

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.

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.