laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.82k stars 636 forks source link

Failed to find a valid digest in the 'integrity' attribute for resource. After upgrading to Laravel 11 #1435

Closed MarceloLuis1997 closed 2 months ago

MarceloLuis1997 commented 2 months ago

Horizon Version

5.21

Laravel Version

11.0

PHP Version

8.3.6

Redis Driver

Predis

Redis Version

7.0.2

Database Driver & Version

MySQL 8.0.31

Description

After upgrading to Laravel 11 and PHP 8.3.6, my Horizon dashboard has ceased to function properly in production mode. Upon attempting to access /horizon, the console output indicates three errors:

Failed to find a valid digest in the 'integrity' attribute for resource 'https://mywebsite.com.br/vendor/horizon/styles.css' with computed SHA-384 integrity 'jF5Ipw7xyM9ulJ6sSawoFGoP0DyWrNryxV3zg8zSKrTHPXJKG6vmTzV8x+swGakj'. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource 'https://mywebsite.com.br/vendor/horizon/styles-dark.css' with computed SHA-384 integrity 'SsyNiFtI+7ZBfSgg9Uzd5Ig0DDBnNbnv2pMqiH4QYYaUSEVpPud6rpiZjQ13ErZM'. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource 'https://mywebsite.com.br/vendor/horizon/app.js' with computed SHA-384 integrity '1a+yk9Q/GiPNVQWQIctwzo6wfiVom8RndXD8BddmOykTw//pM3RnTPjzVZK+Uvin'. The resource has been blocked.

All three integrity attributes differ from those listed in my public/vendor/horizon/manifest.json file. Strangely, in localhost, everything functions correctly, with the integrity attributes generated in the HTML matching those in my manifest.json file.

I've attempted to update Horizon assets using php artisan horizon:publish, but to no avail. Additionally, I've followed all the steps outlined in the Horizon upgrading guide.

Steps To Reproduce

Install laravel 11.0 and Laravel Horizon.

Run php artisan horizon:publish.

Access /horizon URL and it will not properly load the HTML and outputs errors in console.

ValCanBuild commented 2 months ago

This looks similar to https://github.com/laravel/horizon/issues/1426 which is already fixed and awaiting release.

driesvints commented 2 months ago

This is now fixed in v5.24.4