Fatal error in Sage11: /wp-content/cache/acorn/framework\cache directory must be present and writable

Hello!
I wanted to try using the new Sage11 on Windows without WSL.
I use LocalWP for local development, and I created a new site and deployed Sage to it using

composer create-project roots/sage mytheme

Next, since I’m using Sage without Bedrock, I replaced the path with the correct one in the vite.config.js file. After that, I used npm run build and got a critical error:

Fatal error: Uncaught Exception: The C:\Users\serge\Local Sites\sandbox-sage11-release\app\public/wp-content/themes/mytheme\C:\Users\serge\Local Sites\sandbox-sage11-release\app\public/wp-content/cache/acorn/framework\cache directory must be present and writable. in C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Illuminate\Foundation\PackageManifest.php:179 
Stack trace: 
#0 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Roots\Acorn\PackageManifest.php(91): Illuminate\Foundation\PackageManifest->write(Array) 
#1 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Illuminate\Foundation\PackageManifest.php(108): Roots\Acorn\PackageManifest->build() 
#2 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Illuminate\Foundation\PackageManifest.php(91): Illuminate\Foundation\PackageManifest->getManifest() 
#3 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Illuminate\Foundation\PackageManifest.php(80): Illuminate\Foundation\PackageManifest->config('aliases') 
#4 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Roots\Acorn\Bootstrap\RegisterFacades.php(25): Illuminate\Foundation\PackageManifest->aliases() 
#5 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Illuminate\Foundation\Application.php(342): Roots\Acorn\Bootstrap\RegisterFacades->bootstrap(Object(Roots\Acorn\Application)) 
#6 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Illuminate\Foundation\Http\Kernel.php(187): Illuminate\Foundation\Application->bootstrapWith(Array) 
#7 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Roots\Acorn\Application\Concerns\Bootable.php(114): Illuminate\Foundation\Http\Kernel->bootstrap(Object(Illuminate\Http\Request)) 
#8 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Roots\Acorn\Application\Concerns\Bootable.php(40): Roots\Acorn\Application->bootHttp() 
#9 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Roots\Acorn\Configuration\ApplicationBuilder.php(149): Roots\Acorn\Application->bootAcorn() 
#10 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\functions.php(38): Roots\Acorn\Configuration\ApplicationBuilder->boot() 
#11 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-settings.php(672): include('C:\\Users\\serge\\...') 
#12 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-config.php(103): require_once('C:\\Users\\serge\\...') 
#13 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-load.php(50): require_once('C:\\Users\\serge\\...') 
#14 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-blog-header.php(13): require_once('C:\\Users\\serge\\...') 
#15 C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\index.php(17): require('C:\\Users\\serge\\...') 
#16 {main} thrown in **C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme\vendor\roots\acorn\src\Illuminate\Foundation\PackageManifest.php on line 179**

the required directory is present and if I delete it it is recreated but the error persists.

I also tried running wp acorn vendor:publish as suggested [here] (Cache Directory not present or writable issue - #2 by AlexHay) and got the following output in WP CLI:

C:\Users\serge\Local Sites\sandbox-sage11-release\app\public\wp-content\themes\mytheme>wp acorn vendor:publish
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
2 Likes

Someone else reported this on Windows too, but I thought it was something with their environment in particular. I’ll see if I can’t figure out a fix in Acorn.

Can you try composer require roots/acorn:dev-fix/windows-storage-path and see if it works?

Edit: don’t think this fixes it yet. will update if i figure something out.

You are right, it did not help. The error remained the same.

1 Like

I have the same problem. :skull: :sob:

Fixed through this PR by @QWp6t: ⏪ use absolute paths in `Application::usePaths()` by QWp6t · Pull Request #443 · roots/acorn · GitHub. There’ll probably be a release coming for this soon. Change your Acorn version to dev-main instead of ^5.0 if you want to get the fix right away.

Yes, it really works! I reinstalled Acorn using

composer require roots/acorn dev-main

and everything works as expected. Thanks a lot!