Open reinhart1010 opened 6 months ago
I am getting a somewhat similar error... I created a new Leaf 3 MVC app, and when I run leaf serve
the assets can only be referenced on /public/assets/...
due to the combination of .htaccess
and index.php
files.
The following works as expected:
php -S localhost:8000 -t public/
Taking a look at this
@mychidarko Bug on this code line
It should be true
here, not /
Taking a look at this
@mychidarko Can you fix this in the composer package? I've attached a screenshot of the fix above.
I'm currently testing a few updates along with the fix. I'll have a new version out soon @phederal
I forgot to check back here @JensRoland @reinhart1010 @phederal. Has this issue been fixed?
Describe the bug At least in Leaf 3, the
assets()
function (used to get the absolute URL path for asset files) behaves differently betweenleaf serve
and production (LiteSpeed Enterprise).To Reproduce The Leaf MVC starter template (obtainable from
leaf create project-name --mvc --v3
) already contains a CSS<link rel="stylesheet">
declaration referring to a dynamically-generated path using theassets('css/styles.css')
function. When trying to run the app usingleaf serve
, the web app styles loaded correctly, rendering the CSS tag as:However, when trying to deploy the app to production (using LiteSpeed Enterprise Server, and possibly reproducible in OpenLiteSpeed and Apache) when the website's root points to the
public/
folder, the web server renders the style declaration as:Breaking the overall external CSS and JS paths.
This is reproducible in: