Hi there,
trying to get the url of an image from the public directory of my sage theme i get a wrong uri.
My environment is based on bedrock, sage and bud using laravel valet.
The method \Roots\asset(‘images/svg/logo-header.svg’) returns wrong path and uri.
As temporary workaround it works.
Using \Roots\asset(‘logo-header.svg’ I get this url: https://mysyte.test/app/themes/themename/public/logo-header.svg
without the repetition but the images folder is missing.
So the issue seems to be caused by subdirectories in asset folder.
Sage version is 10.1.7 and Bud version is 5.8.7.
I can’t figure how, but today after running up the project, the asset() method works as expected.
I think it could depends on the clearing of the cache but it is really strange because yesterday i ran wp acorn config:clear && wp acorn view:clear && wp acorn optimize:clear and after that it wasn’t still working.
Anyway now it’s working. Im’ really sorry for wasting your time.
I’ll study more on it trying to understand what happened. If I’ll found an explanation I’ll let you know.