Target class [sage.view] does not exist!

Effectively a duplicate of this issue:

I set up a Sage 10.5.1 theme, with Acorn V3 as well as attempted installs with V3.1 and V2.X…I have the following Symfony exception on the frontend :

Target class [sage.view] does not exist.

It seems to be due to the following declaration in [theme-name]/index.php :

<div id="app">
  <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
</div>

Is it a wrong config of my theme or local environment ?

I precise I’m .running my local env via a Docker setup with DDEV on WSL2, I’m normally respecting all needed config (PHP version…etc…). I installed Acorn via the plugin in Wordpress backoffice.

Thank you for any help !

Any FSE/Gutenberg in that Sage theme? I encountered this error message, and in my case there was a theme.json and the required FSE templates in templates/, but remove_theme_support('block-templates'); was still used in the theme. This caused a contradictory state: FSE is enabled, but block templates feature is not.

Have you followed the recommendations in that thread?
Specifically, have you referenced this PR to make certain your theme is compatible with Acorn v3?

1 Like

@Galiro do you have the themes/yourtheme/storage/framework and themes/yourtheme/storage/logs directories?

I didn’t use the CLI method of installing Sage which I think creates these dirs and I got the same errors.

1 Like

I have exactly the same issue, I’m not able to resolve it.
I’ve also checked all the files to be compatible with Acorn 3.1. Everything seems oke.