Open ncla opened 1 year ago
Same issue for me on the following setup...
Environment
Application Name: Evergrace
Laravel Version: 9.26.1
PHP Version: 8.0.22
Composer Version: 2.3.5
Environment: local
Debug Mode: ENABLED
URL: evergrace.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Statamic
Addons: 7
Antlers: runtime
Version: 3.3.31 PRO
Statamic Addons
4rn0/statamic-v3-image-optimizer: 1.0.15
aryehraber/statamic-logbook: 2.1.0
statamic/collaboration: 0.4.0
statamic/ssg: 1.2.0
swiftmade/statamic-clear-assets: 1.1.0
webographen/statamic-admin-log: 1.0.6
withcandour/aardvark-seo: 2.0.28
This workaround allowed me to build and copied all my images across :)
https://github.com/statamic/ssg/issues/91#issuecomment-1083455400
Be sure to add it after the $directory
variable (ie line 113 for me)
Just wanted to give this a little bump and mention I've also been having this issue. I've been unable to SSG sites and have been hosting them with caching set to full
instead for now.
This also affects undocumented glide:data_url
tag as well, and to some extent Responsive Images addon as it uses the same logic as this tag to retrieve asset image contents, which is used to generate blurry placeholder. The error is a bit slightly different but it is same source of problem. https://github.com/spatie/statamic-responsive-images/issues/178
I can confirm that workaround posted in #91, adding this code Generator.php after line with $directory..
variable lets ssg:generate
run without errors.
config([
'statamic.assets.image_manipulation.cache' => true,
'statamic.assets.image_manipulation.cache_path' => $this->config['destination'].'/'.$directory,
]);
I've managed to get this working by setting glide.override to false in the ssg.php config file. Not sure how long that setting has been there, but I think it was added specifically to solve this issue.
'glide' => [
'directory' => 'img',
'override' => false,
],
Then also remember to add your image directory to the "copy" array
public_path('img') => 'img',
Reproducible repository (branch:
ssg-glide-cache-bug
): https://github.com/ncla/statamic-bugs/tree/ssg-glide-cache-bugTo reproduce, simply have an asset field, and have such templating:
Then run commands in such order:
Which will produce the following output:
If I remove
try .. catch
in Generate class over here https://github.com/statamic/ssg/blob/d5664b7b9aca4352d06ea4c5e2f27722a7d6e06c/src/Generator.php#L280-L291 I can retrieve helpful exceptions as otherwise they are not logged or outputted anywhere otherwise.From quick glance (looking at the exceptions posted lower) it seems the culprit might be the Glide cache recent changes that were implemented, as the failing code in Glide.php tag is here https://github.com/statamic/cms/blob/1ef7efc0de680cdc82655a20ac54cae11c579fe7/src/Tags/Glide.php#L112
Using normal glide tag without pair like this..
{{ glide:assets_field fit="max" }}
..does not trigger that part of the code, and does not fail the SSG generation.
Stacktraces, three exceptions:
Support details:
This is separate, organized, continuation issue of https://github.com/statamic/ssg/issues/91 as it was getting a bit messy there.