Target class [sage.view] does not exist

I set up a Sage 10 theme, 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 !

I got this error once after merging branches and in my case checking out the repo in a fresh folder fixed it. So everything in the repo after the merge was good, but something in that local such as caches or other files must have been the cause.

I never found out what really caused it, but it sounds like your scenario is with a fresh instance of Sage. So I don’t know this will help.

Acorn as a plugin has had some issues too, might look through here for threads about that, but I don’t know about that specifically. I’ve only ever installed Acorn in Bedrock at the root of the projects.

1 Like

I’m having exactly the same issue. Fresh Sage install on WSL and get the [sage.view] does not exist error.

Are y’all using Acorn v2 or v3? Sage 10 right now expects Acorn v2 and requires some modifications to work with v3

Yeah I think I bumped into the same issue using Acorn v3. I didn’t notice the

Target class [sage.view] does not exist.

errors right away, because I was using it in a headless theme (no front-end views), but it’s the same error.

Problem fixed by downgrading Acorn from v3 to v2, thank you very much for your help !
Also thanks everyone for other anwsers and suggestions !

Have a nice day