【We're sorry, but...】Herokuでアプリをリリースしたらエラーが出た件 #2（備忘録）

# 【We're sorry, but...】Herokuでアプリをリリースしたらエラーが出た件 #2（備忘録）

僕の中で、世の中で一番恐ろしい長方形です
We're sorry, but something went wrong!!!
<img width="451" alt="スクリーンショット 2020-03-07 11.03.09.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/411851/bf915e7a-0120-14ec-7168-24b3b1976f19.png">

やっとリリースできたのに！
そう思って何が原因かと思い、

```terminal:terminal
> heroku logs --tail
```
を打ってみると、

```terminal:terminal
[2262533e-0eda-4363-80d5-dae786ab4f5d] ActionView::Template::Error (Webpacker can't find application in /app/public/packs/manifest.json. Possible causes:
2020-03-06T23:24:34.856297+00:00 app[web.1]: 1. You want to set webpacker.yml value of compile to true for your environment
2020-03-06T23:24:34.856298+00:00 app[web.1]: unless you are using the `webpack -w` or the webpack-dev-server.
2020-03-06T23:24:34.856298+00:00 app[web.1]: 2. webpack has not yet re-run to reflect updates.
2020-03-06T23:24:34.856299+00:00 app[web.1]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
2020-03-06T23:24:34.856299+00:00 app[web.1]: 4. Your webpack configuration is not creating a manifest.
2020-03-06T23:24:34.856300+00:00 app[web.1]: Your manifest contains:
2020-03-06T23:24:34.856301+00:00 app[web.1]: {
2020-03-06T23:24:34.856302+00:00 app[web.1]: "application.js": "/packs/js/application-f09b38235916b51efe8a.js",
2020-03-06T23:24:34.856302+00:00 app[web.1]: "application.js.map": "/packs/js/application-f09b38235916b51efe8a.js.map",
2020-03-06T23:24:34.856302+00:00 app[web.1]: "entrypoints": {
2020-03-06T23:24:34.856303+00:00 app[web.1]: "application": {
2020-03-06T23:24:34.856306+00:00 app[web.1]: "js": [
2020-03-06T23:24:34.856307+00:00 app[web.1]: "/packs/js/application-f09b38235916b51efe8a.js"
2020-03-06T23:24:34.856307+00:00 app[web.1]: ],
2020-03-06T23:24:34.856308+00:00 app[web.1]: "js.map": [
2020-03-06T23:24:34.856308+00:00 app[web.1]: "/packs/js/application-f09b38235916b51efe8a.js.map"
2020-03-06T23:24:34.856309+00:00 app[web.1]: ]
2020-03-06T23:24:34.856309+00:00 app[web.1]: },
2020-03-06T23:24:34.856309+00:00 app[web.1]: "js/application": {
2020-03-06T23:24:34.856309+00:00 app[web.1]: "js": [
2020-03-06T23:24:34.856310+00:00 app[web.1]: "/packs/js/js/application-dce3b2cd2e34dc243855.js"
2020-03-06T23:24:34.856310+00:00 app[web.1]: ],
2020-03-06T23:24:34.856311+00:00 app[web.1]: "js.map": [
2020-03-06T23:24:34.856311+00:00 app[web.1]: "/packs/js/js/application-dce3b2cd2e34dc243855.js.map"
2020-03-06T23:24:34.856311+00:00 app[web.1]: ]
2020-03-06T23:24:34.856312+00:00 app[web.1]: }
2020-03-06T23:24:34.856312+00:00 app[web.1]: },
2020-03-06T23:24:34.856312+00:00 app[web.1]: "js/application.js": "/packs/js/js/application-dce3b2cd2e34dc243855.js",
2020-03-06T23:24:34.856313+00:00 app[web.1]: "js/application.js.map": "/packs/js/js/application-dce3b2cd2e34dc243855.js.map"
2020-03-06T23:24:34.856313+00:00 app[web.1]: }
2020-03-06T23:24:34.856313+00:00 app[web.1]: ):
2020-03-06T23:24:34.856314+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]      5:     <%= csrf_meta_tags %>
2020-03-06T23:24:34.856314+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]      6:     <%= csp_meta_tag %>
2020-03-06T23:24:34.856314+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]      7:     <%= javascript_pack_tag 'application' %>
2020-03-06T23:24:34.856315+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]      8:     <%= stylesheet_pack_tag 'application' %>
2020-03-06T23:24:34.856317+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]      9:     <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
2020-03-06T23:24:34.856317+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]     10:     <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
2020-03-06T23:24:34.856318+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]     11:     <meta name="viewport" content="width=device-width, initial-scale=1" />
2020-03-06T23:24:34.856318+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d]
2020-03-06T23:24:34.856319+00:00 app[web.1]: [2262533e-0eda-4363-80d5-dae786ab4f5d] app/views/layouts/application.html.erb:8
```

恐ろしい...

```terminal:terminal
ActionView::Template::Error (Webpacker can't find application in /app/public/packs/manifest.json.
```

この部分を読むと、何やらwebpacker関連のお話らしい

```terminal:terminal
app/views/layouts/application.html.erb:8
```

なぜか名指しで怒られているので、この子をhtml.erbから削除してあげた。
この子はwebpackに関連しているもので、私の場合webpackerに以上があったようで、
この削除によって問題が解決されました！！

ちょっと理解の範囲を超えた！

参考：
Herokuでのリリース方法など
https://qiita.com/kazukimatsumoto/items/a0daa7281a3948701c39

消したらなんとかなる問題
https://teratail.com/questions/218944