LoginSignup
0

More than 3 years have passed since last update.

bladeで"syntax error, unexpected end of file"に少し泣かされた

Posted at

bladeで「syntax error, unexpected end of file」というエラーが出たので、
ファイルの最後の方をいろいろ見ていましたが、見当違いでした。

原因は、
@elseなどのブレード構文の前後に半角スペースを入れず、
@if(a>b)ほげ@elseふが@endif
などと そのまま文章をつなげていたことでした。

適切にスペースを挿入してやると、
正しくif文などが評価され、エラー解消。

原因究明に少しだけ時間を食われたので、ここにメモいたします。

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