ノンカフェインであなたにやさしい

Ruby,Rails,HTML,CSS,Reactなど

webpackerでA JSON text must at least contain two octets! (JSON::ParserError)と怒られた話

エラー内容

rails crails s をすると以下のエラーが
webpack系のjsonのパースが上手くいっていないよっていうエラーっぽい

Exiting
Traceback (most recent call last):
    51: from bin/rails:4:in `<main>'
  50: from bin/rails:4:in `require'
   49: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<top (required)>'
  48: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke'
    47: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform'
  46: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
   45: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
  44: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    43: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `perform'
  42: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `tap'
   41: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:147:in `block in perform'
  40: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:51:in `start'
    39: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
  38: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:354:in `wrapped_app'
   37: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:27:in `app'
  36: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:219:in `app'
    35: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:319:in `build_app_and_options_from_config'
  34: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:40:in `parse_file'
   33: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `new_from_string'
  32: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `eval'
    31: from config.ru:in `<main>'
  30: from config.ru:in `new'
   29: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize'
  28: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
    27: from config.ru:1:in `block in <main>'
  26: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
   25: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
  24: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
    23: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
  22: from /share/config/environment.rb:5:in `<top (required)>'
   21: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
  20: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
    19: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
  18: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
   17: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
  16: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in `call'
    15: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in `each'
  14: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
   13: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
  12: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    11: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
  10: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
    9: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
   8: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
     7: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/webpacker-3.5.3/lib/webpacker/railtie.rb:79:in `block in <class:Engine>'
   6: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/webpacker-3.5.3/lib/webpacker.rb:26:in `bootstrap'
    5: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/webpacker-3.5.3/lib/webpacker/commands.rb:15:in `bootstrap'
   4: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/webpacker-3.5.3/lib/webpacker/manifest.rb:18:in `refresh'
     3: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/webpacker-3.5.3/lib/webpacker/manifest.rb:70:in `load'
   2: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/json-7f4cfd853f2c/lib/json/common.rb:155:in `parse'
    1: from /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/json-7f4cfd853f2c/lib/json/common.rb:155:in `new'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/json-7f4cfd853f2c/lib/json/common.rb:155:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError)

対応

public/packs/manifest.json が完全な空ファイルになっていたので空のjsonを入れてあげる

{}

このファイル何も編集していないはずなのになぜ急に…