前提・実現したいこと
RailsでWebアプリを作っています。
git push herokuをするとエラーが出てしまいます。
エラーコードは下述いたします。
また、試したことも複数あるので、そちらも下述いたします。
程度の低い質問でしたら申し訳ございません。
また、質問に必要な情報等に不足があれば、お手数ですがご指摘いただければ、追記いたします。
よろしくお願いいたします。
エラーコード
remote: Compiling… remote: Compilation failed: remote: EntryModuleNotFoundError: Entry module not found: Error: Can't resolve 'babel-loader' in '/tmp/build_e5449219' remote: at /tmp/build_e5449219/node_modules/@rails/webpacker/node_modules/webpack/lib/Compilation.js:1075:31 remote: at /tmp/build_e5449219/node_modules/@rails/webpacker/node_modules/webpack/lib/NormalModuleFactory.js:401:22 remote: at /tmp/build_e5449219/node_modules/@rails/webpacker/node_modules/webpack/lib/NormalModuleFactory.js:130:21 remote: at /tmp/build_e5449219/node_modules/@rails/webpacker/node_modules/webpack/lib/NormalModuleFactory.js:337:24 remote: at /tmp/build_e5449219/node_modules/neo-async/async.js:2830:7 remote: at /tmp/build_e5449219/node_modules/neo-async/async.js:6877:13 remote: at /tmp/build_e5449219/node_modules/neo-async/async.js:2830:7 remote: at done (/tmp/build_e5449219/node_modules/neo-async/async.js:2925:13) remote: at /tmp/build_e5449219/node_modules/@rails/webpacker/node_modules/webpack/lib/NormalModuleFactory.js:449:23 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:213:14 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js:30:40 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/forEachBail.js:30:14 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1) remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43 remote: at /tmp/build_e5449219/node_modules/enhanced-resolve/lib/Resolver.js:285:5 remote: at eval (eval at create (/tmp/build_e5449219/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1) remote: resolve 'babel-loader' in '/tmp/build_e5449219' remote: Parsed request is a module remote: using description file: /tmp/build_e5449219/package.json (relative path: .) remote: resolve as module remote: /tmp/node_modules doesn't exist or is not a directory remote: /node_modules doesn't exist or is not a directory remote: looking for modules in /tmp/build_e5449219/node_modules remote: using description file: /tmp/build_e5449219/package.json (relative path: ./node_modules) remote: using description file: /tmp/build_e5449219/package.json (relative path: ./node_modules/babel-loader) remote: no extension remote: /tmp/build_e5449219/node_modules/babel-loader doesn't exist remote: .js remote: /tmp/build_e5449219/node_modules/babel-loader.js doesn't exist remote: .json remote: /tmp/build_e5449219/node_modules/babel-loader.json doesn't exist remote: as directory remote: /tmp/build_e5449219/node_modules/babel-loader doesn't exist remote: 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: bbfca2874754e6f2cf38567dd94edd114f6f4d5d remote: ! remote: ! We have detected that you have triggered a build from source code with version bbfca2874754e6f2cf38567dd94edd114f6f4d5d 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 damp-hollows-86048. remote: To https://git.heroku.com/damp-hollows-983456.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/damp-hollows-86948.git' //herokuのドメイン名は漏洩防止のため書き換えました
試したこと
https://teratail.com/questions/196073
こちらの記事で書かれている対処法は全て試しましたが、改善しませんでした。
yarn add babel-loader
も実行しましたが、ダメでした。
補足情報(FW/ツールのバージョンなど)
Rails 6.0.3
Ruby 2.6.3
AWS Cloud9を使用
あなたの回答
tips
プレビュー