🎼

GitHub.io の Actions でエラーになって対処した話

2021/07/25に公開

自身の作成コンテンツのひとつ で GitHub.io を利用しており、Architect テーマを使いつつ SCSS を書き換えてレイアウト等をカスタマイズしています。

先日、レイアウト関連の内容には特に何も変更を加えていない状態で、コミット時の GitHub Actions によるデプロイで下記のエラーが発生するようになりました。

The page build failed for the `main` branch with the following error:

Your SCSS file `assets/css/style.scss` has an error on line 1: File to import not found or unreadable: architect.
Load path: /tmp/jekyll-remote-theme-20210723-7-do3291/_sass.
For more information, see https://docs.github.com/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites#invalid-sass-or-scss.

For information on troubleshooting Jekyll see:
  https://docs.github.com/articles/troubleshooting-jekyll-builds

import が読み込めないと言われているのですが、何も変えていないんだけどなぁ…と。

該当箇所の記述は下記の通り。

@import "{{ site.theme }}";

こちらは公式リポジトリでも指定されている記述であり、そういう意味では問題ないはずの記述です。

ググっても特に目ぼしい情報は無く、まぁ site.theme を引っ張ってくるのが上手くいっていないのかなと予想して、明示的に指定してみました。

@import "jekyll-theme-architect";

先ほどのエラーは発生せず、デプロイが完了しました🤔

もし、似たようなエラーが発生している方がいらっしゃったら、参考にしてみていただければと思います。

Discussion