エラー解決: `Error: Asset 'application.css' was not declared to be precompiled`

エラー内容

ActionView::Template::Error (Asset 'application.css' was not declared to be precompiled in production.
Declare links to your assets in 'app/assets/config/manifest.js'.

  //= link application.css
and restart your server):

解決策

  1. manifest.jsを設定していないければ、設定
  2. manifest.js設定済みであれば、rake tmp:clear

関連Notes

assets:precompile呼び出し時にvite:buildが自動で呼ばれる

Deployment 🚀 | Vite Ruby

参考リンク

Error: Asset 'application.css' was not declared to be precompiled in production · Issue #458 · rails/sprockets-rails · GitHub