LoginSignup
0
0

[備忘録] Railsアプリケーションでtailwind.cssが読み込まれないとき

Posted at

起こったこと

railsアプリケーションでcssがうまく読み込めなかった
error内容はこんな感じ

The resource ファイル名 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

試したこと

1. ブラウザのキャッシュクリア

効果なし

2. tailwind.css の再ビルド

いったん app/assets/builds 配下のファイルを削除 (今回はtailwind.css)

$ rails assets:clobber

その後 tailwind.css を再びビルド

$ rails tailwindcss:build

app/assets/builds/tailwind.css が再生成され、cssが読み込まれるようになった

余談

今回ちゃんと原因を調べずに、とりあえず読み込めないならrebuildしてみよう、で解決してしまった。
時間のある時にでも原因を探ってみようと思う。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0