New error popping up when I to deploy my rails app after making some minor text changes

Just started happening after this minor change.

=> ERROR [stage-4 8/8] RUN bin/rails fly:build 10.9s

[stage-4 8/8] RUN bin/rails fly:build:
#26 4.218 ➀ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker :+1:
#26 4.219
#26 4.369 ➀ YN0000: β”Œ Resolution step
#26 5.021 ➀ YN0061: β”‚ querystring@npm:0.2.0 is deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
#26 5.297 ➀ YN0061: β”‚ chokidar@npm:2.1.8 is deprecated: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
#26 5.482 ➀ YN0061: β”‚ uuid@npm:3.4.0 is deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() Β· V8 for details.
#26 5.632 ➀ YN0061: β”‚ fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
#26 5.885 ➀ YN0032: β”‚ nan@npm:2.17.0: Implicit dependencies on node-gyp are discouraged
#26 6.224 ➀ YN0061: β”‚ source-map-resolve@npm:0.5.3 is deprecated: See GitHub - lydell/source-map-resolve: [DEPRECATED] Resolve the source map and/or sources for a generated file.
#26 6.448 ➀ YN0061: β”‚ resolve-url@npm:0.2.1 is deprecated: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
#26 6.449 ➀ YN0061: β”‚ source-map-url@npm:0.4.1 is deprecated: See GitHub - lydell/source-map-url: [DEPRECATED] Tools for working with sourceMappingURL comments.
#26 6.452 ➀ YN0061: β”‚ urix@npm:0.1.0 is deprecated: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
#26 6.894 ➀ YN0032: β”‚ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
#26 7.650 ➀ YN0061: β”‚ @npmcli/move-file@npm:2.0.1 is deprecated: This functionality has been moved to @npmcli/fs
#26 7.651 ➀ YN0061: β”‚ @npmcli/move-file@npm:1.1.2 is deprecated: This functionality has been moved to @npmcli/fs
#26 8.367 ➀ YN0061: β”‚ flatten@npm:1.0.3 is deprecated: flatten is deprecated in favor of utility frameworks such as lodash.
#26 8.733 ➀ YN0061: β”‚ svgo@npm:1.3.2 is deprecated: This SVGO version is no longer supported. Upgrade to v2.x.x.
#26 8.772 ➀ YN0061: β”‚ stable@npm:0.1.8 is deprecated: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: Array.prototype.sort() - JavaScript | MDN
#26 9.849 ➀ YN0032: β”‚ evp_bytestokey@npm:1.0.3: Implicit dependencies on node-gyp are discouraged
#26 10.29 ➀ YN0000: β”” Completed in 5s 919ms
#26 10.38 ➀ YN0000: β”Œ Post-resolution validation
#26 10.38 ➀ YN0028: β”‚ The lockfile would have been modified by this install, which is explicitly forbidden.
#26 10.38 ➀ YN0000: β”” Completed
#26 10.38 ➀ YN0000: Failed with errors in 6s 13ms
#26 10.47 I, [2023-01-20T02:00:05.776828 #1] INFO – : Writing /app/public/assets/error-156d4702ea339f07f4afcf1b3a8376da763dea6f9dc6461f2602c8d3c6371a84.png
#26 10.47 I, [2023-01-20T02:00:05.777521 #1] INFO – : Writing /app/public/assets/gritter-close-b45e4e3265c1091c50b3531a5a7a21b726b397adb6ca081d82797e0d29165781.png
#26 10.47 I, [2023-01-20T02:00:05.778104 #1] INFO – : Writing /app/public/assets/gritter-84f45eb6efbd0f9313e3cf0d81dcea4cbb2ed8552c6babeca799f71a8d879213.png
#26 10.47 I, [2023-01-20T02:00:05.778819 #1] INFO – : Writing /app/public/assets/ie-spacer-c404c6ad7ced964722cc14635cc2e0a5b924b13c4120c02e51f6d16d39553c3a.gif
#26 10.47 I, [2023-01-20T02:00:05.779204 #1] INFO – : Writing /app/public/assets/notice-e348463c1fa5eabe612eb21ac03b550b5e9278df27b26dc21d745205c1fd9bee.png
#26 10.47 I, [2023-01-20T02:00:05.779657 #1] INFO – : Writing /app/public/assets/progress-4401130d700faadafe42bf322264e2689dae9ded22c1186c38ad2699d28b9715.gif
#26 10.47 I, [2023-01-20T02:00:05.779938 #1] INFO – : Writing /app/public/assets/success-abc60b9ec6e86a3254ee885da0f04a6d2b9c68e044ee5976710d7b8bf8fdddc3.png
#26 10.47 I, [2023-01-20T02:00:05.780128 #1] INFO – : Writing /app/public/assets/warning-c8acc23f866cdb032492373cc343f0121f867e0eb28f5efe1c0b0de71371133c.png
#26 10.47 I, [2023-01-20T02:00:05.780793 #1] INFO – : Writing /app/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js
#26 10.47 I, [2023-01-20T02:00:05.781526 #1] INFO – : Writing /app/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js.gz
#26 10.47 I, [2023-01-20T02:00:05.781876 #1] INFO – : Writing /app/public/assets/favicon-99f7ffd3b4b4f5f0dc6803372c4e1f1a3347e305d56651e29879f5a66c622f5a.ico
#26 10.47 I, [2023-01-20T02:00:05.782597 #1] INFO – : Writing /app/public/assets/favicon-99f7ffd3b4b4f5f0dc6803372c4e1f1a3347e305d56651e29879f5a66c622f5a.ico.gz
#26 10.47 I, [2023-01-20T02:00:05.783356 #1] INFO – : Writing /app/public/assets/programmer-e0e84c7fb09cf1e99f4639229eac577fd631a4c88f1074f73f6769382f7a8849.jpg
#26 10.47 I, [2023-01-20T02:00:05.783952 #1] INFO – : Writing /app/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
#26 10.47 I, [2023-01-20T02:00:05.784399 #1] INFO – : Writing /app/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
#26 10.47 I, [2023-01-20T02:00:05.784926 #1] INFO – : Writing /app/public/assets/contacts-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
#26 10.47 I, [2023-01-20T02:00:05.785351 #1] INFO – : Writing /app/public/assets/contacts-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
#26 10.47 I, [2023-01-20T02:00:05.785823 #1] INFO – : Writing /app/public/assets/portfolio-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
#26 10.47 I, [2023-01-20T02:00:05.786079 #1] INFO – : Writing /app/public/assets/portfolio-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
#26 10.85 Webpacker requires Yarn β€œ>=1 <4” and you are using 4.0.0-rc.36
#26 10.85 Please upgrade Yarn Installation | Yarn
#26 10.85 Exiting!


Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -o pipefail -c ${BUILD_COMMAND}]: exit code: 1

Looks like you are using Yarn v1, something is upgrading you to a pre-release of yarn 4, and then something else isn’t happy with that version. What fun.

It looks like running the following commands will get you a good version of yarn:

yarn init -2
yarn set version stable

Then, run yarn -v, and update the ARG YARN_VERSION= line in your Dockerfile.

Thank you! I am getting farther now… But now it seems this error is being raised:
Error failed to fetch an image or build from source: error building: failed to compute cache key: β€œ/app/node_modules” not found: not found

Here is the output.
==> Verifying app config
β†’ Verified app config
==> Building image
Remote builder fly-builder-spring-night-8625 ready
==> Creating build context
β†’ Creating build context done
==> Building image with Docker
β†’ docker host: 20.10.12 linux x86_64
[+] Building 1.8s (0/1)
[+] Building 19.8s (23/26)
=> [internal] load remote build context 0.0s
=> copy /context / 0.3s
=> resolve image config for docker.io/docker/dockerfile:experimental 0.3s
=> CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5 0.0s
=> [internal] load metadata for Quay 0.2s
=> [base 1/6] FROM Quay 0.0s
=> CACHED [base 2/6] RUN mkdir /app 0.0s
=> CACHED [base 3/6] WORKDIR /app 0.0s
=> CACHED [base 4/6] RUN mkdir -p tmp/pids 0.0s
=> CACHED [base 5/6] RUN curl https://get.volta.sh | bash 0.0s
=> CACHED [base 6/6] RUN volta install node@16.17.0 yarn 0.0s
=> CACHED [stage-4 1/8] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt 0.0s
=> CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt 0.0s
=> [node_modules 1/3] COPY packagejson ./ 0.0s
=> CACHED [gems 1/3] RUN gem update --system --no-document && gem install -N bundler -v 2.3.10 0.0s
=> CACHED [gems 2/3] COPY Gemfile
./ 0.0s
=> [node_modules 2/3] COPY yarn.* ./ 0.0s
=> CANCELED [gems 3/3] RUN bundle install && rm -rf vendor/bundle/ruby/*/cache 18.7s
=> [node_modules 3/3] RUN volta install yarn && yarn install; 18.4s
=> CACHED [stage-4 2/8] COPY --from=gems /app /app 0.0s
=> CACHED [stage-4 3/8] COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions 0.0s
=> CACHED [stage-4 4/8] COPY --from=gems /usr/local/bundle /usr/local/bundle 0.0s
=> ERROR [stage-4 5/8] COPY --from=node_modules /app/node_modules /app/node_modules 0.0s

[stage-4 5/8] COPY --from=node_modules /app/node_modules /app/node_modules:


Error failed to fetch an image or build from source: error building: failed to compute cache key: β€œ/app/node_modules” not found: not found

That step should have built /app/node_modules. Try changing it to

RUN volta install yarn@3.3.1 && yarn install

… substituting in the correct version of Yarn.