Target class [sage.view] does not exist on Shared Server

Sage 10, fresh installation July/August 2023.
This is my first time working with Sage 10, I did few sites with Sage 9 a while back.
My local dev environment is working okay. I need to show something to my client and copied my WP install with the Sage theme to my shared Siteground server. Sage 9 has been working fine with Siteground without any deployment issues.

I did the Deployment steps:
yarn build
composer install --no-dev

Copied over all files & folders, except node_modules.
When I try to view my site all pages are blank.
In the debug.log it says:
PHP Fatal error: Uncaught ReflectionException: Class “sage.view” does not exist in /home/…/public_html/proto/wp-content/themes/mytheme/vendor/illuminate/container/Container.php:889

I checked older posts about this issue but it does not look like my issue has the same cause.
The ThemeServiceProvider.php looks like the earlier ‘fixes’ and I do not know where else to look.

Also, the ‘Target class [sage.view] does not exist’ post from February 2023 does not seem to have been resolved.

I’m still in development but finally this site will need to be deployed through plain FTP so I do need to find a fix.

Solved the problem. Problem was confusing, but I saw another error message in my debug.log which mentioned a file in wp-content/cache/acorn/framework/views/.
Since I’m new to Acorn I did not know that Acorn kept a cache.
And I deployed my full dev install by just copying over the full installation folder, thereby also copying my local Acorn cache folder.

When I renamed the wp-content/cache folder I suddenly started seeing my templates again.

I hope this helps someone else, because I could have spent much more time before I would have figured out this unexpected cache.

2 Likes

hi i’m getting same as your issue. But i not understand which you renamed the wp-content/cache folder???

If you’re having the same issue and you need to clear the view cache, finding it depends on your setup.

If you use ssh to connect to the server, you can navigate to your theme folder and run wp acorn cache:clear.

If you need to do this manually:

  • using bedrock, then it’s probably web/app/cache/acorn that you need to delete
  • using a standard installation it’s probably wp-content/cache/acorn