Closed jhm-ciberman closed 7 months ago
Looks like a duplicate of https://github.com/laravel/horizon/issues/1425
Closing and waiting for the next release.
@driesvints is this fixed in master? Currently the Horizon UI is unusable for me in production.
Horizon Version
v5.24.3
Laravel Version
11.x
PHP Version
8.3
Redis Driver
PhpRedis
Redis Version
-
Database Driver & Version
-
Description
Brief
If you configure your
ASSET_URL
: (https://laravel.com/docs/11.x/vite#custom-base-urls)Then the Horizon CSS won't load at all:
Chrome Dev Console:
Description of the bug
The problem relies in that Horizon uses a new instance of
\Illuminate\Foundation\Vite
for injecting the CSS and javascript:The problem, is that this generates a tag like this:
In order for the browser to check the data integrity and use the integrity tag:
Access-Control-Allow-Origin: *
). ✅crossorigin
attribute must be defined in the<link>
tag and set toanonymous
. ❌How To Fix
Simply add
'crossorigin' => 'anonymous'
to both tags:Steps To Reproduce
ASSET_URL
to point to a CDN:Ensure the CDN is sending the proper CORS headers.