Roots Discourse

Uncaught InvalidArgumentException: View not found

Just uploaded some new code to my production server and got slapped with this error message: There has been a critical error on your website.

Upon further inspection it seems like the site crashes on all pages utilizing the blocks I’ve created with sage-acf-wp-blocks and ACF Builder

Everything works fine on my Local by Flywheel instance locally, no error in the logs or anything. I’ve run composer install on both theme and bedrock dir both on prod and dev so they’re the same.

It’s shared hosting and I haven’t been able to find the actual error logs, but there was some output in the email that WordPress itself sent out when it noticed something was broken:

An error of type E_ERROR was caused in line 137 of the file /home/client/public_html/app/themes/qntm/vendor/illuminate/view/FileViewFinder.php. Error message: Uncaught InvalidArgumentException: View [views.blocks.hero] not found. in /home/client/public_html/app/themes/qntm/vendor/illuminate/view/FileViewFinder.php:137
Stack trace:
#0 /home/client/public_html/app/themes/qntm/vendor/illuminate/view/FileViewFinder.php(79): Illuminate\View\FileViewFinder->findInPaths('views.blocks.he...', Array)
#1 /home/client/public_html/app/themes/qntm/vendor/illuminate/view/Factory.php(128): Illuminate\View\FileViewFinder->find('views.blocks.he...')
#2 [internal function]: Illuminate\View\Factory->make('views.blocks.he...', Array, Array)
#3 /home/client/public_html/app/themes/qntm/vendor/roots/sage-lib/Template/Blade.php(138): call_user_func_array(Array, Array)
#4 /home/client/public_html/app/themes/qntm/vendor/roots/sage-lib/Template/Blade.php(58): Roots\Sage\Template\Blade->__call('make', Array)
#5 /home/client/public_html/app/themes/qntm/app/helpers.php(55): Roots\Sage\Template\Blade->render('views/blocks/he...', Array)

In resources/views/blocks/ there is a file called hero.blade.php, so that file itself is there.

If I create a new page without any of my custom blocks it works just fine.

Followed this guide to get setup with sage-acf-wp-blocks: https://baillieogrady.com/custom-gutenberg-blocks-acf-fields-with-roots-sage

I don’t use Trellis to deploy this site, I simply push to a git repo on the server and then manually run composer install and yarn build --production afterwards.

Edit: Using Bedrock 1.14.3 and Sage 9.0.9

Any ideas?

Turned out it there’s an issue with sage-acf-wp-blocks with a fix that I had applied locally (and forgotten about), but when deploying and using composer install fix was missing so thus: errors.