Sylius / Sylius-Standard

Open Source eCommerce Application on top of Symfony
https://sylius.com
MIT License
251 stars 329 forks source link

Cannot resolve images shipped with fixtures #885

Open Ferror opened 1 year ago

Ferror commented 1 year ago

Environement

Fresh installation of Sylius-Standard by docker on 7.12.2022. Development and production environment.

Introduction

With adding webpack to the Sylius and Sylius-Standard the problem of missing thumbnails generated by liip package occurred. I don't know what the reason behind it is, but I would like to document the issue. Based on Sylius Community Slack the problem does exist without the usage of docker too.

Screenshot 2022-12-07 at 23 01 17 Screenshot 2022-12-07 at 23 00 11

Example

We have http://localhost/media/cache/resolve/sylius_shop_product_thumbnail/f4/cf/35bf6a62b06e31be473ac49d0ec9.jpg imageit does NOT exist inpublic/media` directory for Nginx and PHP containers. Well, the directory is empty.

Therefore we are missing some steps in Docker or Webpack.

The file responsible for loading the image -> https://github.com/Sylius/Sylius/blob/1.12/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig

Logs

[2022-12-07T22:33:21.964352+00:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
"Source image for path "6b/fd/1c6ee947b9a6cd20d5599be9322a.jpg" could not be found"
at /srv/sylius/vendor/liip/imagine-bundle/Controller/ImagineController.php line 168 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): Source image for path \"6b/fd/1c6ee947b9a6cd20d5599be9322a.jpg\" could not be found at /srv/sylius/vendor/liip/imagine-bundle/Controller/ImagineController.php:168)

[previous exception] [object] (Liip\\ImagineBundle\\Exception\\Binary\\Loader\\NotLoadableException(code: 0): Source image not resolvable \"6b/fd/1c6ee947b9a6cd20d5599be9322a.jpg\" in root path(s) \"/srv/sylius/public/media/image\" at /srv/sylius/vendor/liip/imagine-bundle/Binary/Locator/FileSystemLocator.php:47)"} []
valentin-harrang commented 1 year ago

Same issue? https://github.com/Sylius/Sylius-Standard/issues/893