Webpacker manifest empty, styles load after

Viewed 843

When I try accessing a page from my website deployed on Heroku, I get the error:

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

Here is the solution it shows me:

1. You want to set webpacker.yml value of compile to true for your environment
unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
}
):
8:     <%= stylesheet_pack_tag "application", media: 'all', 'data-turbolinks-track': 'reload' %>
9:     <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
10: 
11:     <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
12:     <script src="https://js.stripe.com/v3/"></script>
13: 
14:     <%= favicon_link_tag asset_path('favicon.ico') %>

What looks surprising to me is that there seems to be something in the manifest, but it only get's added after the brackets. Would love to see if someone can tell me if this is the issue here and how to fix it.

1 Answers

Try running this after you copy files:

bundle exec rake assets:precompile

I was overwriting manifest.json with an empty one.

Related