craftcms / spoke-and-chain

Craft CMS + Craft Commerce demo site.
https://craftcms.com/demo?kind=spokeandchain
BSD Zero Clause License
54 stars 28 forks source link

CSS and JS files paths are not correct if website is installed in server subdirectory #129

Open piotrpog opened 2 years ago

piotrpog commented 2 years ago

This is most likely related to Twigpack plugin. There is console errors like this:

bootstrap:108 Uncaught (in promise) Error: Loading CSS chunk 1 failed.
(/assets/dist/css/styles.6f82a377c329418c8101.css)
    at r.<computed>.r.<computed>.<computed>.t.push.r.<computed>.d.onerror (bootstrap:108:17)

It seems that javascript is trying to load files with address like http://localhost/assets/dist/js/styles.6f82a377c329418c8101.js, ignoring subdirectory. File links in Twig files are outputted correctly and contain subdirectory in which Craft is installed.

JayGreentree commented 1 year ago

Open the .env file and change DEFAULT_SITE_URL= to your desired url