blade template files are not compiled on production

Over the past week, we encountered the same issue on two separate projects after deploying to production: Blade templates failed to compile and instead rendered as plain text.

Example output:

@extends('layouts.app')
@section('content')
// etc.

There were no errors in the log files or deployment logs.

Project 1

  • Long-running project using Sage 10
  • PHP 8.3
  • Ubuntu 24.04
  • Acorn v4.3.1
  • generoi/sage-woocommerce 1.1.3

Project 2

  • Newer sage 10 project
  • PHP 8.3
  • Ubuntu 24.04
  • Acorn v5.0.4

In both cases, the only solution was restoring from a backup.

With Project 2, I was able to redeploy successfully after the restore, and the issue did not reoccur. I have not redeployed project 1 yet.

I came across this old post:

e class='quote' data-post="1" data-topic="10175">
I have one Wordpress install running on live environment (also previously correct on local). When I tried to press Live Preview when editing menu’s on live, there was an error “helper missing”, i tried to solve it locally. But from that moment everything went down hill real quick… When everything wasn’t working as intended, I tried to make a copy of live environment, but right now it is just outputting plain blade template code. I can see it is loading the correct template, but blade is not re…

describing the same behavior, but it doesn’t include a clear solution.

Has anyone else experienced this, or found a root cause or workaround?

Are you by chance running PHP 8.3.20? If so, try upgrading to 8.3.21+ – It seems like .20 had some bugs.

1 Like

Thanks for the reply.

Both projects run on 8.3.20, i will update to .21

Do these bugs also exists in php 8.4.x?

Not sure about 8.4.x - but I personally ran into the issue on 8.3.20 with my sites using RunCloud. I didn’t realize what was happening until I stumbled upon all the comments on Blade is not rendering the views, which are displayed as raw php. · laravel/framework · Discussion #52382 · GitHub

Once I updated PHP (RunCloud’s agent) and redeployed (or at the very least, cleared my view cache), everything went back to normal.

1 Like

Thanks for the link, i should keep an eye out for laravel if i get similar problems in the future.
After the php update in runcloud, deploying worked as expected again.

Both projects had multiple deployments while php 8.3.20 was active, so it still feels a bit random.