1

I have Magento CE 2.3 on production mode the my store running OK but some times some JS & jQuery gives 404 and the website request in-existing assets from pub/static which causes the whole website to stop.

I found many answers suggesting to switch to Production mode which my store is already in Production mode.

and to switch Symlink to COPY in app/etc/di.xml

 <virtualType name="developerMaterialization" type="Magento\Framework\App\View\Asset\MaterializationStrategy\Factory">
    <arguments>
        <argument name="strategiesList" xsi:type="array">
            <item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\</item>
            <item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
        </argument>
    </arguments>
</virtualType>

which I already did

the problem goes away if I flush the cache and enable it again after running bin/magento setup:static-content:deploy -f en_US ar_SA how can I fix of even debug this issue it is very critical

this is the log in side myProject/var/log/exception.log

main.CRITICAL: Path  var/view_preprocessed/pub/static/ cannot be used with directory  var/view_preprocessed/pub/static
 {"exception":"[object] (Magento\\Framework\\Exception\\ValidatorException(code: 0): Path var/view_preprocessed/pub/static
cannot be used with directory var/view_preprocessed/pub/static at vendor/magento/framework/Filesystem/Directory/PathValidator.php:63)"} []
5
  • please check this link ipfs-sec.stackexchange.cloudflare-ipfs.com/magento/A/question/… i hope it will be helpfull in your case. Mar 9, 2020 at 11:06
  • my store already in production and assets already in COPY mode not in SYMLINK mode
    – Diaa
    Mar 10, 2020 at 10:11
  • Please, post your js errors. Mar 10, 2020 at 14:26
  • @KhoaTruongDinh I updated my question with log from exception.log
    – Diaa
    Mar 13, 2020 at 16:08
  • how to be sure the project in production php bin/magento deploy:mode:show Current application mode: production. (Note: Environment variables may override this value.)
    – Diaa
    Mar 17, 2020 at 7:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.