@HeRoYo (裕希 吉田)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

herokuでデプロイができない

解決したいこと

Ruby on Railsでブログのアプリを作っています。
一旦、herokuでデプロイをしようと

git push heroku master

を入力しました。
すると、

remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to kanso.
remote: 
To https://git.heroku.com/kanso.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/.git'

このようなエラーが出てしまい、デプロイできません。

エラー文を読んでみても、どこがダメなのか検討もつきません。
ネットで検索をしてみてもどれもピンと来ないものばかりで困っています。

原因と解決策を教えてください。

原因と思われる箇所

remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        USE_YARN_CACHE=true
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:        
remote: -----> Installing binaries

解決策が分からなかった。

remote: -----> Installing dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v1.22.18
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        [3/4] Linking dependencies...
remote:        warning " > webpack-dev-server@4.9.0" has unmet peer dependency "webpack@^4.37.0 || ^5.0.0".
remote:        warning "webpack-dev-server > webpack-dev-middleware@5.3.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
remote:        [4/4] Building fresh packages...
remote:        Done in 9.26s.
remote:        
remote: -----> Build

Doneと出力されているので、おそらく問題無いと思われる。
いくつか同様の警告があったが、いづれもDoneと出力されていた。

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-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.
remote:        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-property-in-object", { "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-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.
remote:        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-property-in-object", { "loose": true }]
remote:        to the "plugins" section of your Babel config.

いくつも同じ文章が出力されていた。
書かれてあるように、Babel configに["@babel/plugin-proposal-private-property-in-object", { "loose": true }]を追加したが、この文章は消えず、エラーも治らなかった。

remote:          Erroneous area:
remote:        1: 2 * $table-border-width
remote:        ^......^
remote:            at /tmp/build_2b591bd8/css/application-ff03134f.css:6:20423
remote:            at Object.parseError (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/parser.js:1200:15)
remote:            at Object.lexer_parseError [as parseError] (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/parser.js:2333:44)
remote:            at Object.lexer_next [as next] (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/parser.js:3328:22)
remote:            at Object.lexer_fastLex [as fastLex] (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/parser.js:3403:18)
remote:            at fastLex (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/parser.js:1603:27)
remote:            at Parser.parse (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/parser.js:1677:30)
remote:            at /tmp/build_2b591bd8/node_modules/postcss-calc/dist/lib/transform.js:33:30
remote:            at walk (/tmp/build_2b591bd8/node_modules/postcss-calc/node_modules/postcss-value-parser/lib/walk.js:7:16)
remote:            at ValueParser.walk (/tmp/build_2b591bd8/node_modules/postcss-calc/node_modules/postcss-value-parser/lib/index.js:18:3)
remote:            at transformValue (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/lib/transform.js:24:50)
remote:            at _default (/tmp/build_2b591bd8/node_modules/postcss-calc/dist/lib/transform.js:66:100)
remote:            at /tmp/build_2b591bd8/node_modules/postcss-calc/dist/index.js:27:32
remote:            at /tmp/build_2b591bd8/node_modules/postcss/lib/container.js:139:18
remote:            at Rule.each (/tmp/build_2b591bd8/node_modules/postcss/lib/container.js:105:16)
remote:            at Rule.walk (/tmp/build_2b591bd8/node_modules/postcss/lib/container.js:135:17)
remote:            at /tmp/build_2b591bd8/node_modules/postcss/lib/container.js:152:24
remote:            at Root.each (/tmp/build_2b591bd8/node_modules/postcss/lib/container.js:105:16)
remote:            at Root.walk (/tmp/build_2b591bd8/node_modules/postcss/lib/container.js:135:17)
remote:            at /tmp/build_2b591bd8/node_modules/postcss-calc/dist/index.js:23:9
remote:            at initializePlugin (/tmp/build_2b591bd8/node_modules/cssnano/dist/index.js:31:51)
remote:        

よくわからなかった。

0 likes

2Answer

Precompiling assets failed. とあるので、まんまプリコンパイルに失敗してるんじゃないでしょうか。

Qiitaでも結構見つかりますけど、参考になるものはありませんか?

0Like

@HeRoYo さん、自分も全く同じエラーに遭遇し、ネット探し回ったのですが、解決策がわかりません。
「 Erroneous area: 1: 2 * $table-border-width」以下、その後は解決できましたでしょうか?

※ Babel configのところは、以下を追加したらエラー表示されなくなりました。

  ],
  [
    "@babel/plugin-proposal-private-methods", 
    {
       "loose": true
    }
  ],
  ['@babel/plugin-proposal-private-property-in-object', 
    {
     loose: true
    }
0Like

Your answer might help someone💌