rails 7.x app using jsbundling-rails
Error output specifically says that I need to enable corepack. I don’t know how I can enable it any further than the build scripts already do…
Any help would be much appreciated!
render.yaml buildCommand: "./bin/render-build.sh"
render-build.sh file
#!/usr/bin/env bash
# exit on error
set -o errexit
echo "bundle install starting..."
bundle install
echo "enabling corepack..."
corepack enable
echo "corepack install..."
corepack install
echo "running yarn..."
yarn
echo "assets precompile starting..."
bundle exec rake assets:precompile
echo "assets clean starting..."
bundle exec rake assets:clean
echo "db:migrate starting..."
bundle exec rails db:migrate
echo "db:seed starting..."
bundle exec rails db:seed
Output of build process:
<trimmed> everything above looks as expected
enabling corepack...
==> Using Node.js version 20.15.0 via /opt/render/project/src/.nvmrc
==> Docs on specifying a Node.js version: https://render.com/docs/node-version
==> Using Bun version 1.1.0 (default)
==> Docs on specifying a bun version: https://render.com/docs/bun-version
corepack install...
Adding yarn@4.2.2 to the cache...
running yarn...
➤ YN0000: · Yarn 4.2.2
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 293ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 620 packages were added to the project (+ 139.01 MiB).
➤ YN0000: └ Completed in 14s 388ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.23.1 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:3.32.2 must be built because it never has been before or the last one failed
➤ YN0000: │ core-js@npm:3.32.2 STDOUT Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
➤ YN0000: │ core-js@npm:3.32.2 STDOUT
➤ YN0000: │ core-js@npm:3.32.2 STDOUT The project needs your help! Please consider supporting core-js:
➤ YN0000: │ core-js@npm:3.32.2 STDOUT > https://opencollective.com/core-js
➤ YN0000: │ core-js@npm:3.32.2 STDOUT > https://patreon.com/zloirock
➤ YN0000: │ core-js@npm:3.32.2 STDOUT > https://boosty.to/zloirock
➤ YN0000: │ core-js@npm:3.32.2 STDOUT > bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
➤ YN0000: │ core-js@npm:3.32.2 STDOUT
➤ YN0000: │ core-js@npm:3.32.2 STDOUT I highly recommend reading this: https://github.com/zloirock/core-js/blob/master/docs/2023-02-14-so-whats-next.md
➤ YN0000: │ core-js@npm:3.32.2 STDOUT
➤ YN0000: └ Completed in 7s 133ms
➤ YN0000: · Done in 22s 158ms
assets precompile starting...
error This project's package.json defines "packageManager": "yarn@4.2.2". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
rake aborted!
jsbundling-rails: Command install failed, ensure yarn is installed
/opt/render/project/.gems/ruby/3.3.0/gems/jsbundling-rails-1.3.1/lib/tasks/jsbundling/build.rake:6:in `block (2 levels) in <main>'