[sage 10] Target class [assets] does not exist

I try to use the asset function in sage 10 as I had in sage 9.
However, this causes an error message (in a nice new error screen though):

Target class [assets] does not exist.

https://github.com/roots/acorn/blob/master/src/helpers.php#L45-L55 (make sure you use the namespace unless you set 'globals' => true in config/app.php)

Will this be sufficient in the file that should use the asset() function?

use function Roots\asset;

I also require PHP files in the setup.php to separate concerns of the theme (e.g. Gutenberg, WooCommerce, Google Fonts, etc).

Alright, so I found out the reason…
I replace the translation domain sage with the slug of the theme (e.g. company-theme),
however, the usual and quite careless approach of just using search-replace of 'sage' to 'company-theme' also changes other code than just the translation domain, hence the theme fails to load afterwards.

1 Like

For convenience: The line in question is add_teme_support(‘sage’) located in /bootstrap/app.php

1 Like