Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dj75's avatar
Level 1

php artisan serve, vite and http (not https)

Whenever I use: npm run build php artisan serve

And then run my test within Gitlab CI my tests fail because the links to my assets (js/css) are https even when the site is accessed over http.

Why is this?

I've noticed the same behaviour locally, with my local Apache development setup too. No matter how I access the site, the @vite directives to serve assets in the blade.php files turn into https links.

Where is this configured?

With mix, if you accessed the site over http you'd get the js/css over http too. Why is vite doing something different and always assuming https?

0 likes
1 reply
dj75's avatar
Level 1

nevermind, I figured it out.

it's ASSET_URL in the environment file. Mine wasn't working because I'd upgraded from an earlier v of laravel and that line in the config / app.php file was missing.

Please or to participate in this conversation.