前提・実現したいこと
Railsでwebアプリを作っています。
git push heroku
をした際に
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding remote: ["@babel/plugin-proposal-private-methods", { "loose": true }] remote: to the "plugins" section of your Babel config. remote: Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
このエラーが出力されます。
このエラーがあまりに大量に、同じ内容が出力されるため、これより上のログは読むことができません。
エラー指示の通りbabel.config.js
を編集したのですが(編集後のソースコードは後述します)、改善しません。
このエラー以下のログは
remote: 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: aef904aaa638d2253e7b46eca4c3b40e46e510f2 remote: ! remote: ! We have detected that you have triggered a build from source code with version aef904aaa638d2253e7b46eca4c3b40e46e510f2 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-hollow. remote: To https://git.heroku.com/damp-hollow.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/damp-hollo.git'
となっております。
どうすればこのエラーを解決できるでしょうか。
程度の低い質問でしたら申し訳ございません。
また、質問に必要な情報等に不足があれば、お手数ですがご指摘いただければ、追記いたします。
よろしくお願いいたします。
該当のソースコード
javasctipt
1[babel.config.js] 2module.exports = function(api) { 3 var validEnv = ['development', 'test', 'production'] 4 var currentEnv = api.env() 5 var isDevelopmentEnv = api.env('development') 6 var isProductionEnv = api.env('production') 7 var isTestEnv = api.env('test') 8 9 if (!validEnv.includes(currentEnv)) { 10 throw new Error( 11 'Please specify a valid `NODE_ENV` or ' + 12 '`BABEL_ENV` environment variables. Valid values are "development", ' + 13 '"test", and "production". Instead, received: ' + 14 JSON.stringify(currentEnv) + 15 '.' 16 ) 17 } 18 19 return { 20 presets: [ 21 isTestEnv && [ 22 '@babel/preset-env', 23 { 24 targets: { 25 node: 'current' 26 }, 27 loose: true 28 } 29 ], 30 (isProductionEnv || isDevelopmentEnv) && [ 31 '@babel/preset-env', 32 { 33 forceAllTransforms: true, 34 useBuiltIns: 'entry', 35 corejs: 3, 36 modules: false, 37 exclude: ['transform-typeof-symbol'], 38 loose: true 39 } 40 ] 41 ].filter(Boolean), 42 plugins: [ 43 'babel-plugin-macros', 44 '@babel/plugin-syntax-dynamic-import', 45 isTestEnv && 'babel-plugin-dynamic-import-node', 46 '@babel/plugin-transform-destructuring', 47 [ 48 '@babel/plugin-proposal-class-properties', 49 { 50 loose: true 51 } 52 ], 53 54 [ 55 '@babel/plugin-proposal-private-methods', 56 { 57 loose: true 58 } 59 ], 60 61 [ 62 '@babel/plugin-proposal-object-rest-spread', 63 { 64 useBuiltIns: true 65 } 66 ], 67 [ 68 '@babel/plugin-transform-runtime', 69 { 70 helpers: false, 71 regenerator: true, 72 corejs: false 73 } 74 ], 75 [ 76 '@babel/plugin-transform-regenerator', 77 { 78 async: false 79 } 80 ], 81 ].filter(Boolean) 82 } 83} 84
補足情報(FW/ツールのバージョンなど)
Rails 6.0.3
Ruby 2.6.3
AWS Cloud9を使用
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。