voltore
February 21, 2024, 5:32pm
1
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
voltore
February 21, 2024, 5:58pm
2
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?
dom
February 21, 2024, 6:00pm
3
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
# ...
voltore
February 21, 2024, 6:11pm
4
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
dom
February 21, 2024, 6:14pm
5
Yep I’d try adding that and give a deploy a go. That was a recent change I made here:
redwoodjs:main
← redwoodjs:ds-node-version/rm-nvmrc,add-middleware-check
opened 08:15PM - 19 Dec 23 UTC
Continuation of https://github.com/redwoodjs/redwood/pull/8907. Following up on … our meeting today (@Tobbe, @thedavidprice; this PR doesn't implement the configurable engines functionality yet).
This PR
- removes the `.nvmrc` file from CRWA and test project fixtures
Setup deploy commands should add node version files if they need them, preferably something nvm agnostic like Netlify's `.node-version`
- removes yarn from engines in CRWA's root package.json since it doesn't do anything and just creates confusion
- adds a node version check to build and dev
This piece of middleware is lightweight; it doesn't involve a child process or the file system, it just checks against `process.version`. I also removed the babel check because it's been ages since we've made that change and original concerns against checking for the node version were about adding overhead tot he CLI. So let's remove unnecessary middleware if we're going to add more
Right now, the node version check just emits a warning. Should it error out? (I should've taken better notes.)
Build:

Dev:

## Tasks
- [ ] research deploy providers and update `yarn rw setup deploy` commands
- [x] settle on warning or error for build and dev
- [x] settle on the contents of the message
- [x] update CRWA
### Deploy providers
- [x] baremetal
Pretty sure it's completely up to you.
- [x] coherence
Via Nixpacks, `engines.node` in the root package.json: https://nixpacks.com/docs/providers/node#setup.
- [x] flightcontrol
Via Nixpacks, `engines.node` in the root package.json: https://www.flightcontrol.dev/docs/getting-started/javascript/setting-node-version#using-the-packagejson-file.
- [x] netlify
Via the `.node-version` file, or via in `netlify.toml`; see https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript, https://docs.netlify.com/configure-builds/file-based-configuration/#sample-netlify-toml-file.
- [ ] vercel
Takes its cue from engines.node in the root package.json: https://vercel.com/docs/functions/serverless-functions/runtimes/node-js#version-overrides-in-package.json.
- [x] render
Same as netlify more or less, but also respects `engines.node` in the root package.json: https://docs.render.com/docs/node-version.
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.
voltore
February 21, 2024, 6:19pm
6
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 : )
dom
February 21, 2024, 6:27pm
7
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
voltore
February 22, 2024, 11:39am
8
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