91008
### 前提

オリジナルアプリを作っておりますが、herokuでデプロイの際に以下のようなエラーが発生します。

追記  
[teratail](https://teratail.com/questions/3ftkb9ykgh0yur)にもマルチポストさせていただきます。ご了承くださいませ。

### 試したこと

最初に`Precompiling assets
failed.`とターミナルで赤字で書かれていたのでこの文を検索にかけて調べたところアセットパイプラインの正常化が必要と書かれていたのでconfig/application.rbに以下のように記述し再度実行したところ変わらず。

config/application.rb

```

    config.assets.initialize_on_precompile = false
    
```

また再度エラー文を見ると `NoMethodError: undefined method `size' for
nil:NilClass`と書かれてあることに気づきましたが、どこのことを言っているのかがわかりません。  
こちらについても検索をかけて調べましたが当てはまるような記事に辿り着けず苦戦しております。どなたかお分かりになる方おりましたらご教示いただけますと幸いです。

### 環境

MacOS  
Ruby 2.6.5  
Rails 6.0.5.1  
Heroku-18 stack

### エラー文

全文を載せてしまうと長いので怪しい箇所だけ一部抜粋。

```

    エラーメッセージ
    warning " > webpack-dev-server@4.9.3" has unmet peer dependency "webpack@^4.37.0 || ^5.0.0".
           warning "webpack-dev-server > webpack-dev-middleware@5.3.3" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
           [5/5] Building fresh packages...
           Done in 2.78s.
           rake aborted!
           NoMethodError: undefined method `size' for nil:NilClass
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/util.rb:157:in `merge_adjacent_strings'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/tree/prop_node.rb:73:in `initialize'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:848:in `new'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:848:in `css_variable_declaration'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:796:in `try_declaration'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:743:in `declaration_or_ruleset'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:708:in `block_child'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:700:in `block_contents'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:689:in `block'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:681:in `ruleset'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:707:in `block_child'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:700:in `block_contents'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:137:in `stylesheet'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:41:in `parse'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/engine.rb:414:in `_to_tree'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/engine.rb:290:in `render'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/sass_compressor.rb:48:in `call'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/sass_compressor.rb:28:in `call'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:142:in `block in find'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `each'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `each'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `logical_paths'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:140:in `find'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
           /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
           Tasks: TOP => assets:precompile
           (See full trace by running task with --trace)
     !
     !     Precompiling assets failed.
     !
     !     Push rejected, failed to compile Ruby app.
     !     Push failed
    
```
CC BY-SA 4.0
2022-08-29T02:54:56.060
90817
2022-09-09T02:41:03.643
2022-08-29T05:53:11.510
54185
54185
question
ruby-on-rails ruby heroku
Herokuのエラーについて（NoMethodError:〜とPrecompiling assets failed.）
マルチポスト先にて回答をいただきました。  
よって自己解決とさせていただいます。

回答内容:「app/assets/stylesheets/application.css」の下記の記述を削除

```

    *= ./bootstrap_import 
    *= require bootstrap/dist/css/bootstrap.min.css 
    
```

その後Bootstrapのバージョンを5.2.0から5.1.3にダウングレードしたところデプロイ成功。
CC BY-SA 4.0
2022-09-09T02:41:03.643
91008
2022-09-09T02:41:03.643
54185
90817
answer