Q&A
前提
- rails
- heroku ciでテスト
上記でテストを実行したいのですが下記のエラーが出てしまいます。
Failure/Error: <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> ActionView::Template::Error: Webpacker can't find application.js in /app/public/packs-test/manifest.json. Possible causes: 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: { } # ./app/views/layouts/application.html.erb:17:in `_app_views_layouts_application_html_erb__591291322096808254_93220' # ./spec/requests/plans_spec.rb:49:in `block (3 levels) in <main>' # ------------------ # --- Caused by: --- # Webpacker::Manifest::MissingEntryError: # Webpacker can't find application.js in /app/public/packs-test/manifest.json. Possible causes: # 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: # { # } # ./app/views/layouts/application.html.erb:17:in `_app_views_layouts_application_html_erb__591291322096808254_93220'
ただ、webpacker.ymlは下記でcomplieはtrueになっているのでなぜ上記のエラーが出るのか分かっていません。
test: <<: *default compile: true # Compile test packs to a separate directory public_output_path: packs-test
こちらみなさんciでテストする際にwebpackerの設定をどうしているでしょうか?
実現したいこと
上記エラーを解消し、herokuciでテストを通したい
発生している問題・エラーメッセージ
Failure/Error: <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> ActionView::Template::Error: Webpacker can't find application.js in /app/public/packs-test/manifest.json. Possible causes: 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: { } # ./app/views/layouts/application.html.erb:17:in `_app_views_layouts_application_html_erb__591291322096808254_93220' # ./spec/requests/plans_spec.rb:49:in `block (3 levels) in <main>' # ------------------ # --- Caused by: --- # Webpacker::Manifest::MissingEntryError: # Webpacker can't find application.js in /app/public/packs-test/manifest.json. Possible causes: # 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: # { # } # ./app/views/layouts/application.html.erb:17:in `_app_views_layouts_application_html_erb__591291322096808254_93220'
該当のソースコード
webpacker.yml
ruby
1test: 2 <<: *default 3 compile: true 4 5 # Compile test packs to a separate directory 6 public_output_path: packs-test
やったこと
- コマンドからcompileをしたがダメでした
- 下記の記事からapp.jsonでテスト環境構築時にcompileしたがダメでした
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。