8

any comments included in a blade are causing apache to crash when I try to load said page. The project I'm working on uses blade comments for notes and everything, so removing them isn't an option. I'm using xampp on windows.

Anyone have any ideas?

Dalton Gore
  • 919
  • 2
  • 9
  • 21
  • personally, i usually comment it like @if(1==0) comment here @endif i know it's silly, lol. – morgan9999 Jan 28 '15 at 09:07
  • I have the same thing happening, only for unclosed or badly formed comments. `{{-- blah blah --}}` is fine, `{{-- blah blah -- }}` is not – kibibu Jan 29 '15 at 00:07
  • 1
    personally i don't like blade or any other template engine. It's just some extra work for the server to process. – astroanu Jan 30 '15 at 04:05
  • similar question http://stackoverflow.com/questions/27830200/laravel-blade-comments-blade-rendering-causing-page-to-crash – astroanu Jan 30 '15 at 04:07
  • @kibibu is correct: If you have a malformed Blade comment, no code will be parsed until the next – TonyArra Jan 30 '15 at 20:02
  • @TonyArra it's not correct. It crashes *Apache*, which requires a hard restart. – kibibu Feb 02 '15 at 23:27
  • @kibibu even just single-line comments? – TonyArra Feb 03 '15 at 13:47
  • Try using {!-- comment --!}, or possibly {{{ comment }}}. I had a problem similar to this a while back. I don't remember the details but this was the solution I found. – Sturm Feb 05 '15 at 22:20
  • Does this answer your question? [Laravel - Blade comments , blade rendering causing page to crash](https://stackoverflow.com/questions/27830200/laravel-blade-comments-blade-rendering-causing-page-to-crash) – TonyArra Feb 23 '23 at 18:44

1 Answers1

10

You must ensure that your blade opening and closing tags are correct and don't use the @ character in the comment:

{-- Should work --}

{-- @will crash --}

{--

that @doesn't work either

--}
Nicolas Beauvais
  • 1,042
  • 14
  • 20
  • This was it. I was commenting out some blade stuff with the @sign, and it stopped crashing when they were removed. Thank you! – Dalton Gore Feb 12 '15 at 19:43