Deployment to Render (Yarn versions)

Hi, I’m having trouble deploying a Redwood app (v6.6.4) to Render.com.
I can see a few mentions of similar issues, but no real resolution (?) and certainly no warnings in the official docs.

Render seems to require Yarn version 1.22.21, which seems pretty old now considering we’re up to Yarn 4+.

My RW project was built using Node v18 and Yarn 4.0.2, meeting the pre-reqs in the docs:

There’s no mention of any such issue in the docs on either the Redwood or Render sides:

I must be missing something silly, surely?

Any help well appreciated! I’ve also raised a request on the Render side.

Thanks,
Michael

Any attempts to work around this just throw up more errors.
IE:

  • switched to Yarn 1.22.21
  • set both COREPACK_ROOT & YARN_SKIP_COREPACK_CHECK env vars (from this thread on the subject)

Could anyone advise?
Is reverting to Yarn 1.22.21 the way here or should this be doable with Yarn 4.0.2?

Hey @voltore, does your buildCommand in render.yaml have corepack enable in it at the start like this?

services:
- name: my-app-web
  # ...
  buildCommand: corepack enable && yarn install && yarn rw deploy render web
  # ...

Same for the api:

- name: my-app-api
  # ...
  buildCommand: corepack enable && yarn && yarn rw build api
  # ...

It doesn’t, should it?

#####
# Documentation
# Redwood: https://render.com/docs/deploy-redwood
# YAML (all config values): https://render.com/docs/yaml-spec
#####

services:
- name: list-web
  type: web
  env: static
  buildCommand: yarn install && yarn rw deploy render web
  staticPublishPath: ./web/dist
  envVars:
  - key: NODE_VERSION
    value: 18
  - key: SKIP_INSTALL_DEPS
    value: true
  routes:
  - type: rewrite
    source: /.redwood/functions/*
#####
# NOTE: replace destination api url after first deploy to Render
# example:
#   destination: https://myredwoodproject-api.onrender.com/*
#####
    destination: replace_with_api_url/*
  - type: rewrite
    source: /*
    destination: /200.html

- name: list-api
  type: web
  plan: free
  env: node
  region: oregon
  buildCommand: yarn && yarn rw build api
  startCommand: yarn rw deploy render api
  envVars:
  - key: NODE_VERSION
    value: 18
  - key: DATABASE_URL
    fromDatabase:
      name: list-db
      property: connectionString

databases:
  - name: list-db
    region: oregon


Yep I’d try adding that and give a deploy a go. That was a recent change I made here:

You can also “revert” in the sense that you can check the yarn binary back into version control via this command:

yarn set version latest --yarn-path

Then render should just use that.

To confirm (I’m new to both Redwood and Yarn!): I should be able to stick to my version of Yarn (4.0.2) and use the cmd you suggested to configure the version used in Render?

Edit: apologies, been a long day. Your cmd is just setting latest stable Yarn in the local env isn’t it. Adding the corepack enable && should do the trick.

I’ll give it a spin and reply back here.

V much appreciate the speedy support : )

Thanks for trying out Redwood! Yeah let me be more clear, you have two options:

I’d try the first one and if that doesn’t work for you or you have a reason not to like it opt for the second. You can see Redwood’s deploy target CI here with the config I described in the first bullet point: deploy-target-ci/render.yaml at 57e6b4621f80c40529247a20de9d0230c93b4f99 · redwoodjs/deploy-target-ci · GitHub.

But sounds like you got it!

1 Like

Thanks @dom that’s solved it.

Specifically: Adding corepack enable && to build & start commands in render.yaml.

It then ran into memory issues during API deployment at the stage:
Installing plugin “@redwoodjs/cli-data-migrate”…

This seems to be solved by setting NODE_VERSION to 20 (from 18) as mentioned here

Thanks very much for your help!

Now the only issue appears to be my realtime functionality (via subscriptions) has gone missing. I may open another thread for this :bang-head-on-desk

1 Like