Ok bare with me please. When running Vite in my Laravel 10 installation with npm run dev
the API call's of my webapp run into the following error:
Unable to create lockable file: C:\Websites\website.nl\storage\framework/cache/data/03/bc/03bc23b61d4cf128f2bd79541d52e1b98f18c79d. Please ensure you have permission to create files in this location.
I am running on Windows. But I can use the bash
command that brings me to a Linuxy place thanks to WSL... But I am not sure if that means if I can just do commands like chmod
there. It is kinda new to me.
In short: When running the ViteJs dev server the file permissions are incorrect in the storage
folder.
I tried giving the chmod 775 to the storage folder (via the bash command). And also tried to change the owner of the storage folder and subfolders to www-data.
All to no avail.
So how to fix this error in Windows? Thanks!
BTW: this happens only when running the ViteJs dev server. I also can't run php artisan cache:clear
when running the ViteJs dev server.
Then I will get this error:
ERROR Failed to clear cache. Make sure you have the appropriate permissions.
UPDATE:
After testing for a while I noticed that this problem accurs after like a minute or so of refreshing pages with Vite and hot reloading. After a minute the 1
of the file changes to a 0
. See picture below.