Skip to content

Heroku error: didn't find any digests file && ActionView::Template::Error (Can't find hello_react) #116

@ytbryan

Description

@ytbryan

Step to reproduce:

  1. rails new myapp -d postgresql
  2. add webpacker to gemfile gem 'webpacker', :git => "https://github.com/rails/webpacker.git"
  3. bundle install
  4. rails webpacker:install
  5. rails webpacker:install:vue
  6. rails webpacker:compile
  7. use the <%= javascript_pack_tag 'hello_vue' %>
  8. test on localhost (It works*)
  9. heroku create webpacker-demos-123
  10. git remote add
  11. push to heroku (don't work*)

ERROR (didn't find any digests file)

remote: Using webpacker 1.0 from https://github.com/rails/webpacker.git (at master@8f584dd)
remote: Bundle complete! 16 Gemfile dependencies, 54 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Bundle completed (3.32s)
remote: Cleaning up the bundler cache.
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: I, [2017-02-25T01:31:43.346954 #437] INFO -- : Didn't find any digests file at /tmp/build_a7f573d5e29cf560546c07e2807f75aa/public/packs/digests.json. You must first compile the packs via rails webpacker:compile
remote: sh: 1: ./node_modules/webpack/bin/webpack.js: not found
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 webpacker-demos.
remote:
To https://git.heroku.com/webpacker-demos.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/webpacker-demos.git'
pushing to origin/master

To fix the above error, turns out I need to rake assets:precompile instead of rails webpacker:compile. Should the error message be modified?

Once the assets are precompiled. Pushing to heroku works but leads to another error ( ActionView::Template::Error (Can't find hello_react))

2017-02-25T01:41:14.753037+00:00 heroku[router]: at=info method=GET path="/" host=webpacker-demos.herokuapp.com request_id=44e6cff5-5bbc-46d9-b84c-ced9704e12c3 fwd="138.75.142.195" dyno=web.1 connect=0ms service=35ms status=500 bytes=1669
2017-02-25T01:41:14.730223+00:00 app[web.1]: I, [2017-02-25T01:41:14.730082 #4] INFO -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] Started GET "/" for 138.75.142.195 at 2017-02-25 01:41:14 +0000
2017-02-25T01:41:14.734543+00:00 app[web.1]: I, [2017-02-25T01:41:14.734419 #4] INFO -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] Processing by FrontpagesController#index as HTML
2017-02-25T01:41:14.750165+00:00 app[web.1]: I, [2017-02-25T01:41:14.750028 #4] INFO -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] Rendering frontpages/index.html.erb within layouts/application
2017-02-25T01:41:14.752474+00:00 app[web.1]: I, [2017-02-25T01:41:14.752379 #4] INFO -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] Rendered frontpages/index.html.erb within layouts/application (2.1ms)
2017-02-25T01:41:14.752779+00:00 app[web.1]: I, [2017-02-25T01:41:14.752711 #4] INFO -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] Completed 500 Internal Server Error in 18ms
2017-02-25T01:41:14.754036+00:00 app[web.1]: F, [2017-02-25T01:41:14.753928 #4] FATAL -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3]
2017-02-25T01:41:14.754105+00:00 app[web.1]: F, [2017-02-25T01:41:14.754040 #4] FATAL -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] ActionView::Template::Error (Can't find hello_react-e57d9d18a79d866e81fe in #<Webpacker::Digests:0x007f46977f3110 @path=#Pathname:/app/public/packs/digests.json, @digests={}>):
2017-02-25T01:41:14.754371+00:00 app[web.1]: F, [2017-02-25T01:41:14.754297 #4] FATAL -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] 1: <\h1>Hello world!
2017-02-25T01:41:14.754373+00:00 app[web.1]: [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] 2:
2017-02-25T01:41:14.754375+00:00 app[web.1]: [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] 3: <%# javascript_pack_tag 'hello_vue-819142dc19b77ca48015' %>
2017-02-25T01:41:14.754376+00:00 app[web.1]: [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] 4: <%= javascript_pack_tag 'hello_react-e57d9d18a79d866e81fe' %>
2017-02-25T01:41:14.754426+00:00 app[web.1]: F, [2017-02-25T01:41:14.754370 #4] FATAL -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3]
2017-02-25T01:41:14.754492+00:00 app[web.1]: F, [2017-02-25T01:41:14.754436 #4] FATAL -- : [44e6cff5-5bbc-46d9-b84c-ced9704e12c3] app/views/frontpages/index.html.erb:4:in `_app_views_frontpages_index_html_erb___4234948065689000601_69970601556860'

Is this related to existing issues? I'm still digging

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions