Acorn changed my assets to incorrect path after install. Everything works except CSS/JS now have reference error

First off, lemme say thank for building all these amazing tools! I have been slowly slogging through what has been essentially relearning wordpress development, and I’ve almost got everything setup.

Here is what I currently have installed

@roots/bud: "6.7.3"
@roots/sage: "6.7.3",
bootstrap: "^5.2.3"
roots/acorn: "^3.1"
php: "^8.0"
roots/wordpress: "6.1.1"
roots/bedrock-autoloader: "^1.0",
log1x/sage-svg: "^1.1",

So basically, Bedrock, Sage 10, Bud 3, Acorn 3, PHP 8, and Wordpress 6.1.

At first, I was using Bedrock and Sage 10, then I got Bud 3 working, which is AMAZING! I have used webpack a few other times and I’ve always hated it, so getting Bud 3 not only to work, but also allow me to have a app.css and static.css that is only loaded on the home page, was so slick.

Anyways, after I got a simple static home page almost working, I found that I really wanted to use the @svg directive in my blade templates. So I installed Acorn. If I had one complaint, its that the Acorn install documentation is kinda lacking, the one part just says use trellis (which I tried but had trouble getting that working on my mac, so Im still using the bedrock / acorn / sage served from apache locally)

Once Acorn was installed, I ran the WP CLI commands, and BOOM! My SVG’s started being inlined and everything was awesome. Except for this one problem…

Now my asset files, that used to be working, are no longer working. They are all pointing to an incorrect address.

// Previously Working 
http://blog.test/app/themes/sage/public/js/static.1a2870.js 

// After Acorn they are all pointing to incorrect address
http://blog.test/wp/app/themes/sage/public/js/static.1a2870.js

What do I need to do to make my site not reference the incorrect “/wp/” that acorn is now inserting into all my asset URLs? Im sure its a tiny config change? The blog is loading fine and everything, but none of my styles or js scripts are being loaded in.

If you all could let me know how to fix this I would really appreciate it. That seems to be the missing piece to having my dream wordpress setup. Everything else, asset generation, custom directives, everything, is working great, just that tiny change from acorn that I need to fix.

If there is more info that I need to post lemme know, I dont really have like, an error stack or anything, nothing is broken to speak of, its just adding in that incorrect path to the URLs.

Thanks!

1 Like

Thanks for the kind words! If you’re using Soil, you might be running into this bug:

Hey thanks!

That pointed me in the right direction of what is going on!

The only thing I could think, was because my site is using the /wp/ for stuff like /wp/wp-admin that it should also use the /wp/ for all my URLs, and I was clueless on how to go about correcting that, out side of something really hackey like sym linking a directory or who knows what sort of mess I would have created.

In any case, I now have all my JS and CSS being loaded, and the @SVG directive working, along side Bedrock & Sage 10 w/ Bud.js.

I can’t wait to get really get into some serious dev time now and really being able to code out the site originally dreamed up. I really do think what you all have done here is revolutionary for Wordpress. This is exactly what the project needs, not that AWFUL drag and drop theme builder. Ugh, I could go on a rant about that but I’ll save you, and instead just say Thanks again. I really was blown away by how much you’ve managed to Laravel-ify Wordpress is all the best ways. I really look forward to what else you release!