"git push" failing on Heroku [duplicate] - reactjs

This question already has answers here:
How to deploy reactapp with heroku-22?
(3 answers)
git, Heroku: pre-receive hook declined
(25 answers)
Closed 20 days ago.
I am trying to see how to use React on a Heroku app for the first time.
I followed these tutorials:
https://www.bacancytechnology.com/blog/deploy-react-app-on-heroku
https://stackabuse.com/how-to-deploy-a-react-app-to-heroku/
By the end I hit the issue below when running the command: git push heroku main
I did two trials and had the same problem each time. I do not remember having seen this before. What is the way to handle the situation?
remote: Verifying deploy...
remote:
remote: ! Push rejected to testapp.
remote:
To https://git.heroku.com/testapp.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/testapp.git'
me#My-MacBook testapp %
For more details; this is the complete result of running the git push heroku main command:
me#My-MacBook testapp % git push heroku main
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 8 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 307.67 KiB | 8.10 MiB/s, done.
Total 22 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-22 stack
remote: -----> Using buildpack: mars/create-react-app
remote: -----> React.js (create-react-app) multi app detected
remote:
remote: =====! create-react-app-buildpack has reached end-of-life 🌅
remote: This build may succeed, but the buildpack is no longer maintained.
remote: On the Heroku-22 stack and beyond, this may fail to build at all.
remote:
remote: Please consider migrating to https://nextjs.org or https://remix.run to develop React apps which are deployable using Heroku's Node.js buildpack https://github.com/heroku/heroku-buildpack-nodejs, or you may develop your own create-react-app deployment with Node.js and Nginx buildpacks.
remote:
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
remote: =====> Detected Framework: Multipack
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
remote: =====> Detected Framework: Node.js
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 18.x...
remote: Downloading and installing node 18.13.0...
remote: Using default npm version: 8.19.3
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: added 1470 packages, and audited 1471 packages in 19s
remote:
remote: 231 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 6 high severity vulnerabilities
remote:
remote: To address all issues (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Run `npm audit` for details.
remote:
remote: -----> Build
remote: Running build
remote:
remote: > testapp#0.1.0 build
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Compiled successfully.
remote:
remote: File sizes after gzip:
remote:
remote: 46.6 kB build/static/js/main.c9d4c383.js
remote: 1.78 kB build/static/js/787.49a3df42.chunk.js
remote: 541 B build/static/css/main.073c9b0a.css
remote:
remote: The project was built assuming it is hosted at /.
remote: You can control this with the homepage field in your package.json.
remote:
remote: The build folder is ready to be deployed.
remote: You may serve it with a static server:
remote:
remote: npm install -g serve
remote: serve -s build
remote:
remote: Find out more about deployment here:
remote:
remote: https://cra.link/deployment
remote:
remote:
remote: -----> Caching build
remote: - npm cache
remote:
remote: -----> Pruning devDependencies
remote:
remote: up to date, audited 1471 packages in 4s
remote:
remote: 231 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 6 high severity vulnerabilities
remote:
remote: To address all issues (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Run `npm audit` for details.
remote:
remote: -----> Build succeeded!
remote: =====> Downloading Buildpack: https://github.com/mars/create-react-app-inner-buildpack.git#v9.0.0
remote: =====> Detected Framework: React.js (create-react-app)
remote: Writing `static.json` to support create-react-app
remote: Enabling runtime environment variables
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-static.git#21c1f5175186b70cf247384fd0bf922504b419be
remote: =====> Detected Framework: Static HTML
remote: Stack heroku-22 is not supported!
remote: ! Push rejected, failed to compile React.js (create-react-app) multi app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: f609d0c54516882f24faf2a1b4fcad975cc76b04
remote: !
remote: ! We have detected that you have triggered a build from source code with version f609d0c54516882f24faf2a1b4fcad975cc76b04
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to testapp.
remote:
To https://git.heroku.com/testapp.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/testapp.git'
me#My-MacBook testapp %

As your logs explain, this is not a git push issue but rather heroku version compatibility issue with react. I hope this helps,
https://stackoverflow.com/a/72743983/2699319
> pre-receive hook declined
indicates either that branch is protected from direct pushes OR you lack the permissions to push to that branch. If it's your own project, you can change this in the repository's settings. If it's a group/company project, you might want to ask around for permissions/access.
Since it is called main, I will assume the branch is important for the overall project. You might want to make a pull request then ask your peers to review and approve it.
Alternatively if you are testing this out in a sandbox environment by yourself, you can just force push
git push -f heroku main

Related

Heroku App: Push to Heroku not working. Sprockets::FileNotFound: couldn't find file 'react-server' with type 'application/javascript'

I'm trying to push my project up to Heroku Git but it keep running into errors. This is the latest one I can't figure out:
Counting objects: 100% (99/99), done.
Delta compression using up to 8 threads
Compressing objects: 100% (76/76), done.
Writing objects: 100% (77/77), 712.03 KiB | 4.14 MiB/s, done.
Total 77 (delta 48), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. heroku/nodejs
remote: 2. heroku/ruby
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 16.x...
remote: Downloading and installing node 16.14.2...
remote: Using default npm version: 8.5.0
remote:
remote: -----> Restoring cache
remote: - node_modules is checked into source control and cannot be cached
remote:
remote: -----> Installing dependencies
remote: Prebuild detected (node_modules already exists)
remote: Rebuilding any native modules
remote: rebuilt dependencies successfully
remote: Installing any new modules (package.json)
remote:
remote: up to date, audited 126 packages in 546ms
remote:
remote: 10 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 0 vulnerabilities
remote:
remote: -----> Build
remote: Detected both "build" and "heroku-postbuild" scripts
remote: Running heroku-postbuild
remote:
remote: > sweatstax#1.0.0 heroku-postbuild
remote: > npm run build && npm run deploy && echo 'Client Built'
remote:
remote:
remote: > sweatstax#1.0.0 build
remote: > cd client && npm install --only=dev && npm install && npm run build && cd ..
remote:
remote:
remote: added 1254 packages, and audited 1255 packages in 27s
remote:
remote: 170 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 9 vulnerabilities (7 moderate, 2 high)
remote:
remote: To address issues that do not require attention, run:
remote: npm audit fix
remote:
remote: To address all issues possible (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Some issues need review, and may require choosing
remote: a different dependency.
remote:
remote: Run `npm audit` for details.
remote:
remote: up to date, audited 1255 packages in 2s
remote:
remote: 170 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 9 vulnerabilities (7 moderate, 2 high)
remote:
remote: To address issues that do not require attention, run:
remote: npm audit fix
remote:
remote: To address all issues possible (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Some issues need review, and may require choosing
remote: a different dependency.
remote:
remote: Run `npm audit` for details.
remote:
remote: > client#0.1.0 build
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Compiled with warnings.
remote:
remote: src/App.js
remote: Line 13:8: 'M' is defined but never used no-unused-vars
remote:
remote: src/components/auth/FetchUser.js
remote: Line 25:6: React Hook useEffect has missing dependencies: 'authenticated' and 'setUser'. Either include them or remove the dependency array. If 'setUser' changes too often, find the parent component that defines it and wrap that definition in useCallback react-hooks/exhaustive-deps
remote:
remote: src/components/auth/Profile.js
remote: Line 20:6: React Hook useEffect has a missing dependency: 'user'. Either include it or remove the dependency array react-hooks/exhaustive-deps
remote:
remote: src/components/shared/Dashboard.js
remote: Line 2:10: 'useEffect' is defined but never used no-unused-vars
remote:
remote: src/components/shared/Home.js
remote: Line 1:10: 'Parallax' is defined but never used no-unused-vars
remote:
remote: src/components/shared/MainNav.js
remote: Line 2:10: 'Link' is defined but never used no-unused-vars
remote: Line 3:9: 'Navbar' is defined but never used no-unused-vars
remote: Line 3:23: 'NavItem' is defined but never used no-unused-vars
remote: Line 3:32: 'Dropdown' is defined but never used no-unused-vars
remote:
remote: src/components/workouts/WorkoutForm.js
remote: Line 12:6: React Hook useEffect has missing dependencies: 'calories', 'date', 'dif_level', 'duration', 'elevation', 'id', 'img', 'location', 'note', 'tag', and 'workout_type'. Either include them or remove the dependency array. If 'setWorkout' needs the current value of 'img', you can also switch to useReducer instead of useState and read 'img' in the reducer react-hooks/exhaustive-deps
remote:
remote: src/components/workouts/WorkoutList.js
remote: Line 2:9: 'Link' is defined but never used no-unused-vars
remote: Line 19:17: The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid
remote:
remote: src/components/workouts/WorkoutShow.js
remote: Line 10:10: 'editing' is assigned a value but never used no-unused-vars
remote: Line 10:19: 'setEdit' is assigned a value but never used no-unused-vars
remote: Line 16:4: React Hook useEffect has a missing dependency: 'params.workoutId'. Either include it or remove the dependency array react-hooks/exhaustive-deps
remote: Line 18:99: 'id' is assigned a value but never used no-unused-vars
remote: Line 31:5: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
remote:
remote: src/components/workouts/Workouts.js
remote: Line 5:18: 'Icon' is defined but never used no-unused-vars
remote: Line 12:6: React Hook useEffect has a missing dependency: 'getAllWorkouts'. Either include it or remove the dependency array. If 'getAllWorkouts' changes too often, find the parent component that defines it and wrap that definition in useCallback react-hooks/exhaustive-deps
remote:
remote: src/styles/shared.js
remote: Line 2:10: 'Link' is defined but never used no-unused-vars
remote:
remote: Search for the keywords to learn more about each warning.
remote: To ignore, add // eslint-disable-next-line to the line before.
remote:
remote: File sizes after gzip:
remote:
remote: 217.51 kB build/static/js/main.688b90fb.js
remote: 24.12 kB build/static/css/main.f55bf5b8.css
remote: 1.78 kB build/static/js/787.c4e7f8f9.chunk.js
remote:
remote: The project was built assuming it is hosted at /.
remote: You can control this with the homepage field in your package.json.
remote:
remote: The build folder is ready to be deployed.
remote: You may serve it with a static server:
remote:
remote: yarn global add serve
remote: serve -s build
remote:
remote: Find out more about deployment here:
remote:
remote: https://cra.link/deployment
remote:
remote:
remote: > sweatstax#1.0.0 deploy
remote: > cp -a client/build/. public/
remote:
remote: Client Built
remote:
remote: -----> Caching build
remote: - node_modules
remote:
remote: -----> Pruning devDependencies
remote:
remote: up to date, audited 55 packages in 592ms
remote:
remote: 2 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 0 vulnerabilities
remote:
remote: -----> Build succeeded!
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.10
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.1.1
remote: -----> Installing dependencies using bundler 2.3.10
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Fetching gem metadata from https://rubygems.org/..........
remote: Fetching rake 13.0.6
remote: Installing rake 13.0.6
remote: Fetching concurrent-ruby 1.1.9
remote: Fetching minitest 5.15.0
remote: Fetching builder 3.2.4
remote: Fetching zeitwerk 2.5.4
remote: Installing zeitwerk 2.5.4
remote: Installing minitest 5.15.0
remote: Installing builder 3.2.4
remote: Installing concurrent-ruby 1.1.9
remote: Fetching erubi 1.10.0
remote: Using racc 1.6.0
remote: Fetching crass 1.0.6
remote: Installing erubi 1.10.0
remote: Fetching rack 2.2.3
remote: Fetching nio4r 2.5.8
remote: Installing crass 1.0.6
remote: Installing nio4r 2.5.8 with native extensions
remote: Installing rack 2.2.3
remote: Fetching websocket-extensions 0.1.5
remote: Installing websocket-extensions 0.1.5
remote: Fetching marcel 1.0.2
remote: Installing marcel 1.0.2
remote: Fetching mini_mime 1.1.2
remote: Installing mini_mime 1.1.2
remote: Fetching execjs 2.8.1
remote: Fetching aws_cf_signer 0.1.3
remote: Fetching bcrypt 3.1.17
remote: Installing execjs 2.8.1
remote: Installing aws_cf_signer 0.1.3
remote: Fetching msgpack 1.4.5
remote: Using bundler 2.3.10
remote: Fetching http-accept 1.7.0
remote: Installing bcrypt 3.1.17 with native extensions
remote: Installing http-accept 1.7.0
remote: Installing msgpack 1.4.5 with native extensions
remote: Fetching unf_ext 0.0.8.1
remote: Installing unf_ext 0.0.8.1 with native extensions
remote: Fetching mime-types-data 3.2022.0105
remote: Installing mime-types-data 3.2022.0105
remote: Fetching netrc 0.11.0
remote: Installing netrc 0.11.0
remote: Fetching orm_adapter 0.5.0
remote: Installing orm_adapter 0.5.0
remote: Fetching method_source 1.0.0
remote: Installing method_source 1.0.0
remote: Fetching thor 1.2.1
remote: Installing thor 1.2.1
remote: Fetching pg 1.3.4
remote: Installing pg 1.3.4 with native extensions
remote: Fetching nokogiri 1.13.3 (x86_64-linux)
remote: Installing nokogiri 1.13.3 (x86_64-linux)
remote: Fetching websocket-driver 0.7.5
remote: Installing websocket-driver 0.7.5 with native extensions
remote: Fetching i18n 1.10.0
remote: Installing i18n 1.10.0
remote: Fetching tzinfo 2.0.4
remote: Installing tzinfo 2.0.4
remote: Fetching mail 2.7.1
remote: Installing mail 2.7.1
remote: Fetching rack-test 1.1.0
remote: Installing rack-test 1.1.0
remote: Fetching warden 1.2.9
remote: Installing warden 1.2.9
remote: Fetching sprockets 3.7.2
remote: Installing sprockets 3.7.2
remote: Fetching autoprefixer-rails 10.4.2.0
remote: Installing autoprefixer-rails 10.4.2.0
remote: Fetching mime-types 3.4.1
remote: Installing mime-types 3.4.1
remote: Fetching unf 0.1.4
remote: Installing unf 0.1.4
remote: Fetching loofah 2.15.0
remote: Installing loofah 2.15.0
remote: Fetching activesupport 6.1.5
remote: Installing activesupport 6.1.5
remote: Fetching materialize-sass 1.0.0.1
remote: Installing materialize-sass 1.0.0.1
remote: Fetching domain_name 0.5.20190701
remote: Installing domain_name 0.5.20190701
remote: Fetching rails-html-sanitizer 1.4.2
remote: Installing rails-html-sanitizer 1.4.2
remote: Fetching rails-dom-testing 2.0.3
remote: Installing rails-dom-testing 2.0.3
remote: Fetching globalid 1.0.0
remote: Installing globalid 1.0.0
remote: Fetching activemodel 6.1.5
remote: Installing activemodel 6.1.5
remote: Fetching http-cookie 1.0.4
remote: Fetching actionview 6.1.5
remote: Installing http-cookie 1.0.4
remote: Installing actionview 6.1.5
remote: Fetching activejob 6.1.5
remote: Installing activejob 6.1.5
remote: Fetching puma 5.6.2
remote: Installing puma 5.6.2 with native extensions
remote: Fetching activerecord 6.1.5
remote: Installing activerecord 6.1.5
remote: Fetching rest-client 2.1.0
remote: Installing rest-client 2.1.0
remote: Fetching actionpack 6.1.5
remote: Installing actionpack 6.1.5
remote: Fetching cloudinary 1.22.0
remote: Installing cloudinary 1.22.0
remote: Fetching actioncable 6.1.5
remote: Installing actioncable 6.1.5
remote: Fetching activestorage 6.1.5
remote: Installing activestorage 6.1.5
remote: Fetching actionmailer 6.1.5
remote: Installing actionmailer 6.1.5
remote: Fetching railties 6.1.5
remote: Installing railties 6.1.5
remote: Fetching sprockets-rails 3.4.2
remote: Installing sprockets-rails 3.4.2
remote: Fetching actionmailbox 6.1.5
remote: Installing actionmailbox 6.1.5
remote: Fetching actiontext 6.1.5
remote: Installing actiontext 6.1.5
remote: Fetching responders 3.0.1
remote: Installing responders 3.0.1
remote: Fetching rails 6.1.5
remote: Installing rails 6.1.5
remote: Fetching devise 4.8.1
remote: Fetching bootsnap 1.11.1
remote: Installing devise 4.8.1
remote: Installing bootsnap 1.11.1 with native extensions
remote: Fetching devise_token_auth 1.2.0
remote: Installing devise_token_auth 1.2.0
remote: Bundle complete! 13 Gemfile dependencies, 65 gems now installed.
remote: Gems in the groups 'development' and 'test' were not installed.
remote: Bundled gems are installed into `./vendor/bundle`
remote: Bundle completed (21.02s)
remote: Cleaning up the bundler cache.
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: Type application/netcdf is already registered as a variant of application/netcdf.
remote: rake aborted!
remote: Sprockets::FileNotFound: couldn't find file 'react-server' with type 'application/javascript'
remote: Checked in these paths:
remote: /tmp/build_3175204d/app/assets/javascripts
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/cloudinary-1.22.0/vendor/assets/html
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/cloudinary-1.22.0/vendor/assets/javascripts
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/actioncable-6.1.5/app/assets/javascripts
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/activestorage-6.1.5/app/assets/javascripts
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/actionview-6.1.5/lib/assets/compiled
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/materialize-sass-1.0.0.1/assets/stylesheets
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/materialize-sass-1.0.0.1/assets/javascripts
remote: /tmp/build_3175204d/app/assets/javascripts/server_rendering.js:1
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/resolve.rb:65:in `resolve!'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:399:in `resolve'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:207:in `process_require_directive'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:180:in `block in process_directives'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:178:in `each'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:178:in `process_directives'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:83:in `_call'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:68:in `call'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/bundle.rb:23:in `block in call'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/utils.rb:200:in `dfs'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/bundle.rb:24:in `call'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:134:in `block in find'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `each'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `find'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
remote: /tmp/build_3175204d/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: c9fbb447a2c4489d66841ee044603c1d99e8aef2
remote: !
remote: ! We have detected that you have triggered a build from source code with version c9fbb447a2c4489d66841ee044603c1d99e8aef2
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to sweat-stax.
remote:
To https://git.heroku.com/sweat-stax.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sweat-stax.git'
I am building in React.JS and have updated by Ruby files, Gem files, Bundler, Node, and React. It still keeps running into issues. This is the line that I think it's getting hung up on:
remote: Type application/netcdf is already registered as a variant of application/netcdf.
remote: rake aborted!
remote: Sprockets::FileNotFound: couldn't find file 'react-server' with type 'application/javascript'
Thank you for your help!

Reactjs Express App -Heroku Push Error : The 'yarnPath' could not be read from the 'yarnrc.yml' file

I had deployed a website I am working which is a Reactjs Express App to Heroku. It has deployed for 3 weeks now. But after making some changes to app recently I am not able to push the code to heroku. I am encountering an error when doing a push.
$ git push heroku master
Enumerating objects: 912, done.
Counting objects: 100% (912/912), done.
Delta compression using up to 8 threads
Compressing objects: 100% (725/725), done.
Writing objects: 100% (742/742), 27.42 MiB | 2.69 MiB/s, done.
Total 742 (delta 160), reused 30 (delta 8), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: USE_YARN_CACHE=true
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=false
remote:
remote: -----> Build failed
remote: ! The 'yarnPath' could not be read from the 'yarnrc.yml' file
remote:
remote: It looks like 'yarnrc.yml' is missing the 'yarnPath' value, which is needed
remote: to identify the location of yarn for this build.
remote:
remote: To regenerate 'yarnrc.yml' with the 'yarnPath' value set, make sure Yarn 2
remote: is installed on your local machine and set the version in your project
remote: directory with:
remote:
remote: $ yarn set version berry
remote:
remote: Read more at the Yarn docs: https://yarnpkg.com/getting-started/install#per-project-install
remote:
remote: https://devcenter.heroku.com/articles/nodejs-support
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 21afbb1f965651a191a2a03c3d0047685d8c76fc
remote: !
remote: ! We have detected that you have triggered a build from source code with version 21afbb1f965651a191a2a03c3d0047685d8c76fc
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to jithin-career.
remote:
To https://git.heroku.com/jithin-career.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/jithin-career.git'
I have been trying to find a solution to this for some time. Some of the solutions which was mentioned didn't work for me. Can anyone please help me this issue?
I had a similar problem.
Here is the solution.
locally, run the following command
yarn set version berry
activate Zero-Install in .gitignore
.yarn/*
!.yarn/cache
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
or Deactivate Zero-Install
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
yarn install and apply instllation.
Commit all changes to git repogitory.
git push heroku main
For more information, please refer to the official manual page.
https://devcenter.heroku.com/articles/migrating-to-yarn-2#make-changes-to-source-code

Heroku is saying successful build, but its not working? Deploying a react and ruby on rails

It looks like it's getting something because when I go to my website/users(my backend has users and games) it gives me an empty array for users and permission denied for games(which it should be there are validations). But it just doesn't work at all and I'm new to this I'm confused about where I even troubleshoot this?
picture of the terminal in order 1
picture of the terminal in order 2
picture of the terminal in order 3
picture of the terminal in order 4
picture of the terminal in order 5
/usersOnWebsite
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ sudo service postgresql start
* Starting PostgreSQL 12 database server [ OK ]
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ whoami
zvallarino
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ heroku create flyhome010922
Creating ⬢ flyhome010922... done
https://flyhome010922.herokuapp.com/ | https://git.heroku.com/flyhome010922.git
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ heroku buildpacks:add heroku/nodejs --index 1
Buildpack added. Next release on flyhome010922 will use heroku/nodejs.
Run git push heroku main to create a new release using this buildpack.
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ heroku buildpacks:add heroku/ruby --index 2
Buildpack added. Next release on flyhome010922 will use:
1. heroku/nodejs
2. heroku/ruby
Run git push heroku main to create a new release using these buildpacks.
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ git add .
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ git commit -m "I have faith this time"
On branch main
nothing to commit, working tree clean
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ git push heroku main
Enumerating objects: 980, done.
Counting objects: 100% (980/980), done.
Delta compression using up to 12 threads
Compressing objects: 100% (493/493), done.
Writing objects: 100% (980/980), 473.44 KiB | 7.07 MiB/s, done.
Total 980 (delta 701), reused 561 (delta 472), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. heroku/nodejs
remote: 2. heroku/ruby
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 14.x...
remote: Downloading and installing node 14.18.2...
remote: Using default npm version: 6.14.15
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote: added 0 packages in 0.027s
remote:
remote: -----> Build
remote:
remote: -----> Caching build
remote: - node_modules (nothing to cache)
remote:
remote: -----> Pruning devDependencies
remote: up to date in 0.456s
remote: found 0 vulnerabilities
remote:
remote:
remote: -----> Build succeeded!
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.2.33
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.7.4
remote: -----> Installing dependencies using bundler 2.2.33
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Fetching gem metadata from https://rubygems.org/..........
remote: Fetching rake 13.0.6
remote: Installing rake 13.0.6
remote: Fetching concurrent-ruby 1.1.9
remote: Fetching minitest 5.15.0
remote: Fetching zeitwerk 2.5.1
remote: Fetching builder 3.2.4
remote: Installing zeitwerk 2.5.1
remote: Installing builder 3.2.4
remote: Installing minitest 5.15.0
remote: Fetching erubi 1.10.0
remote: Installing concurrent-ruby 1.1.9
remote: Installing erubi 1.10.0
remote: Fetching racc 1.6.0
remote: Fetching crass 1.0.6
remote: Fetching rack 2.2.3
remote: Installing racc 1.6.0 with native extensions
remote: Installing rack 2.2.3
remote: Installing crass 1.0.6
remote: Fetching nio4r 2.5.8
remote: Fetching websocket-extensions 0.1.5
remote: Installing nio4r 2.5.8 with native extensions
remote: Installing websocket-extensions 0.1.5
remote: Fetching marcel 1.0.2
remote: Fetching mini_mime 1.1.2
remote: Installing marcel 1.0.2
remote: Installing mini_mime 1.1.2
remote: Fetching jsonapi-renderer 0.2.2
remote: Fetching bcrypt 3.1.16
remote: Installing jsonapi-renderer 0.2.2
remote: Installing bcrypt 3.1.16 with native extensions
remote: Fetching msgpack 1.4.2
remote: Installing msgpack 1.4.2 with native extensions
remote: Using bundler 2.2.33
remote: Fetching method_source 1.0.0
remote: Installing method_source 1.0.0
remote: Fetching pg 1.2.3
remote: Installing pg 1.2.3 with native extensions
remote: Fetching thor 1.1.0
remote: Installing thor 1.1.0
remote: Fetching rack-test 1.1.0
remote: Installing rack-test 1.1.0
remote: Fetching websocket-driver 0.7.5
remote: Installing websocket-driver 0.7.5 with native extensions
remote: Fetching i18n 1.8.11
remote: Installing i18n 1.8.11
remote: Fetching tzinfo 2.0.4
remote: Installing tzinfo 2.0.4
remote: Fetching sprockets 4.0.2
remote: Installing sprockets 4.0.2
remote: Fetching mail 2.7.1
remote: Installing mail 2.7.1
remote: Fetching nokogiri 1.12.5 (x86_64-linux)
remote: Installing nokogiri 1.12.5 (x86_64-linux)
remote: Fetching puma 5.5.2
remote: Installing puma 5.5.2 with native extensions
remote: Fetching activesupport 6.1.4.3
remote: Installing activesupport 6.1.4.3
remote: Fetching loofah 2.13.0
remote: Installing loofah 2.13.0
remote: Fetching bootsnap 1.9.3
remote: Installing bootsnap 1.9.3 with native extensions
remote: Fetching rails-dom-testing 2.0.3
remote: Installing rails-dom-testing 2.0.3
remote: Fetching globalid 1.0.0
remote: Installing globalid 1.0.0
remote: Fetching activemodel 6.1.4.3
remote: Installing activemodel 6.1.4.3
remote: Fetching case_transform 0.2
remote: Installing case_transform 0.2
remote: Fetching rails-html-sanitizer 1.4.2
remote: Installing rails-html-sanitizer 1.4.2
remote: Fetching activejob 6.1.4.3
remote: Installing activejob 6.1.4.3
remote: Fetching activerecord 6.1.4.3
remote: Installing activerecord 6.1.4.3
remote: Fetching actionview 6.1.4.3
remote: Installing actionview 6.1.4.3
remote: Fetching actionpack 6.1.4.3
remote: Installing actionpack 6.1.4.3
remote: Fetching actioncable 6.1.4.3
remote: Fetching activestorage 6.1.4.3
remote: Installing activestorage 6.1.4.3
remote: Installing actioncable 6.1.4.3
remote: Fetching actionmailer 6.1.4.3
remote: Installing actionmailer 6.1.4.3
remote: Fetching active_model_serializers 0.10.12
remote: Installing active_model_serializers 0.10.12
remote: Fetching railties 6.1.4.3
remote: Installing railties 6.1.4.3
remote: Fetching sprockets-rails 3.4.2
remote: Installing sprockets-rails 3.4.2
remote: Fetching actionmailbox 6.1.4.3
remote: Installing actionmailbox 6.1.4.3
remote: Fetching actiontext 6.1.4.3
remote: Installing actiontext 6.1.4.3
remote: Fetching rails 6.1.4.3
remote: Installing rails 6.1.4.3
remote: Bundle complete! 10 Gemfile dependencies, 49 gems now installed.
remote: Gems in the groups 'development' and 'test' were not installed.
remote: Bundled gems are installed into `./vendor/bundle`
remote: Bundle completed (19.43s)
remote: Cleaning up the bundler cache.
remote: -----> Detecting rake tasks
remote: -----> Detecting rails configuration
remote:
remote: ###### WARNING:
remote:
remote: There is a more recent Ruby version available for you to use:
remote:
remote: 2.7.5
remote:
remote: The latest version will include security and bug fixes. We always recommend
remote: running the latest version of your minor release.
remote:
remote: Please upgrade your Ruby version.
remote:
remote: For all available Ruby versions see:
remote: https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote:
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> release, web
remote: Default types for buildpack -> console, rake
remote:
remote: -----> Compressing...
remote: Done: 62.3M
remote: -----> Launching...
remote: ! Release command declared: this new release will not be available until the command succeeds.
remote: Released v6
remote: https://flyhome010922.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
remote: Running release command...
remote:
remote: I, [2022-01-09T18:38:11.135797 #16] INFO -- : Migrating to CreateUsers (20211215192349)
remote: == 20211215192349 CreateUsers: migrating ======================================
remote: -- create_table(:users)
remote: -> 0.0131s
remote: == 20211215192349 CreateUsers: migrated (0.0132s) =============================
remote:
remote: I, [2022-01-09T18:38:11.163117 #16] INFO -- : Migrating to CreateGames (20211216234121)
remote: == 20211216234121 CreateGames: migrating ======================================
remote: -- create_table(:games)
remote: -> 0.0105s
remote: == 20211216234121 CreateGames: migrated (0.0105s) =============================
remote:
remote: I, [2022-01-09T18:38:11.180094 #16] INFO -- : Migrating to CreateGameTables (20211216234129)
remote: == 20211216234129 CreateGameTables: migrating =================================
remote: -- create_table(:game_tables)
remote: -> 0.0202s
remote: == 20211216234129 CreateGameTables: migrated (0.0202s) ========================
remote:
remote: I, [2022-01-09T18:38:11.206719 #16] INFO -- : Migrating to CreateHighscores (20211216234153)
remote: == 20211216234153 CreateHighscores: migrating =================================
remote: -- create_table(:highscores)
remote: -> 0.0201s
remote: == 20211216234153 CreateHighscores: migrated (0.0202s) ========================
remote:
remote: Waiting for release.... done.
To https://git.heroku.com/flyhome010922.git
* [new branch] main -> main
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ heroku run rails db:migrate
Running rails db:migrate on ⬢ flyhome010922... up, run.1737 (Free)
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ heroku run rails db:seed
Running rails db:seed on ⬢ flyhome010922... up, run.6674 (Free)
"done seeding yo"
zvallarino#DESKTOP-K5VQL0B:~/Development/flyhome/flyhome$ heroku open
â–¸ Error opening web browser.
â–¸ Error: Exited with code 3
â–¸
â–¸ Manually visit https://flyhome010922.herokuapp.com/ in your browser.
Resolution was to add the scripts
"engines": {
"node": "16.x"
},
"scripts": {
"build": "npm install --prefix client && npm run build --prefix client",
"clean": "rm -rf public",
"deploy": "cp -a client/build/. public/",
"heroku-postbuild": "npm run clean && npm run build && npm run deploy"
}

Heroku heroku-nextjs buildpack build failed

I have an app create in Heroku with a free account.
It's my first Nextjs app. I have created a few react apps and deployed them successfully using the https://github.com/mars/create-react-app-buildpack buildpack,
I am attempting to use the https://github.com/mars/heroku-nextjs.git buildpack. I continue to get the following error when pushing and attempting to build:
Enumerating objects: 695, done.
Counting objects: 100% (695/695), done.
Delta compression using up to 4 threads
Compressing objects: 100% (638/638), done.
Writing objects: 100% (695/695), 406.94 KiB | 1.78 MiB/s, done.
Total 695 (delta 388), reused 20 (delta 13)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/mars/heroku-nextjs.git
remote: -----> App not compatible with buildpack: https://github.com/mars/heroku-nextjs.git
remote: bash: /tmp/codon/tmp/buildpacks/cc998aa50faebde1ea66717737aec22c884e4936/bin/detect: No such file or directory
remote:
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: b1006412ec2d412e7edaed795dcbceff02d98f82
remote: !
remote: ! We have detected that you have triggered a build from source code with version b1006412ec2d412e7edaed795dcbceff02d98f82
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to gurnzapp-test.
I have read everything I can find online about this. The most common error that is in the github issues is that people put package.json in a subdirectory. My package.json is in the root. My project is set up correctly as far as I can tell.
I have tried:
pushing from the main branch directly to heroku's main branch.
pushing from a local development branch in the git push heroku development:main format.
removeing package-lock.json.
Using another buildpack: https://github.com/ryanbahniuk/nextjs-buildpack.git
I'm at a loss as to why I'd have issues building. Any help would be amazing :D
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/mars/heroku-nextjs.git
remote: -----> App not compatible with buildpack: https://github.com/mars/heroku-nextjs.git
remote: bash: /tmp/codon/tmp/buildpacks/cc998aa50faebde1ea66717737aec22c884e4936/bin/detect: No such file or directory
remote:
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
It says App not compatible with buildpack.
This is not a buildpack:
https://github.com/mars/heroku-nextjs
These are buildpacks:
https://github.com/mars/create-react-app-buildpack
https://github.com/heroku/heroku-buildpack-nodejs
You can ignore this buildpack. It does nothing.
https://github.com/ryanbahniuk/nextjs-buildpack
Read how buildpacks work here:
https://devcenter.heroku.com/articles/buildpacks

Heroku Failed Deployment ttf Font

I've downloaded a font file from online with a .ttf extension. I'm loading it in my css like this
#font-face {
font-family: 'ChalkDash';
src: local('ChalkDash'), url(./fonts/ChalkDash.ttf) format('truetype');
}
It works fine on localhost and the font is loaded properly. My html elements get styled with that font to be clear. However, when I deploy to heroku, I get this error:
Counting objects: 30, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (30/30), done.
Writing objects: 100% (30/30), 2.74 KiB | 1.37 MiB/s, done.
Total 30 (delta 23), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> React.js (create-react-app) multi app detected
remote: -----> Configure create-react-app build environment
remote: Using `NODE_ENV=development`
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
remote: =====> Detected Framework: Multipack
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
remote: =====> Detected Framework: Node.js
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=false
remote: NODE_VERBOSE=false
remote: NODE_ENV=development
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 8.x...
remote: Downloading and installing node 8.11.1...
remote: Using default npm version: 5.6.0
remote:
remote: -----> Restoring cache
remote: Loading 2 from cacheDirectories (default):
remote: - node_modules
remote: - bower_components (not cached - skipping)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote: added 113 packages in 12.842s
remote:
remote: -----> Caching build
remote: Clearing previous node cache
remote: Saving 2 cacheDirectories (default):
remote: - node_modules
remote: - bower_components (nothing to cache)
remote:
remote: -----> Pruning devDependencies
remote: Skipping because NODE_ENV is not 'production'
remote:
remote: -----> Build succeeded!
remote: =====> Downloading Buildpack: https://github.com/mars/create-react-app-inner-buildpack.git
remote: =====> Detected Framework: React.js (create-react-app)
remote: Writing `static.json` to support create-react-app
remote: Enabling runtime environment variables
remote:
remote: > reverse-hangman-app#0.1.0 build /tmp/build_b679e081d23e4ff1218d9c24620bc77b
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: Module not found: Error: Can't resolve './fonts/ChalkDash.ttf' in '/tmp/build_b679e081d23e4ff1218d9c24620bc77b/src'
remote:
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! reverse-hangman-app#0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the reverse-hangman-app#0.1.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /app/.npm/_logs/2018-04-24T15_48_50_183Z-debug.log
remote: ! Push rejected, failed to compile React.js (create-react-app) multi app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to limitless-depths-91672.
remote:
To https://git.heroku.com/limitless-depths-91672.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/limitless-depths-91672.git'
I'm just wondering why this is happening. I've browsed so many posts on this forum but couldn't figure out why it won't work and I have tried a bunch of fixes to no avail. Can anyone point me in the right direction?

Resources