Closed nathanaelytj closed 7 months ago
Did you publish the new assets like: https://github.com/laravel/laravel/blob/11.x/composer.json#L39
php artisan vendor:publish --tag=laravel-assets --ansi --force
@mmachatschek Should we possible use a different name for the manifest file? Like horizon-manifest? https://github.com/laravel/horizon/pull/1415
We also updated to the latest Horizon version (5.24.1) and this only seems to be an issue on local environments when running npm run dev
since https://github.com/laravel/horizon/pull/1413. I have a bit more info from debugging:
The issue seems to be that when you run npm run dev
it will use a different path (from the application's vite.config.js
) and attempt to resolve the Horizon dependencies from the resources
directory instead of vendor/horizon
. If you don't run npm run dev
then the assets will load correctly again.
While the layout loading the assets with Vite:asset()
correctly passes the build directory, this is ignored when running in "hot" mode (which is what npm run dev
does).
Reverted everything for now. Thanks all for reporting.
thanks @bramdevries thanks for the debugging info. Will check that
Horizon Version
5.24.1
Laravel Version
11.4.0
PHP Version
8.3.4
Redis Driver
PhpRedis
Redis Version
7.2.4
Database Driver & Version
No response
Description
This update cause a bug when opening horizon dashboard with error like:
GET http://localhost:5173/resources/js/app.js net::ERR_ABORTED 404 (Not Found)
GET http://localhost:5173/resources/sass/styles.scss net::ERR_ABORTED 404 (Not Found)
This is because in some of our project we don't use js anymore but ts files also we don't use styles.scss as entrypoint anymore but another file. This issue will also break any project without those files as entrypoint.
After reading commit history, this file seems to be the culprit:
public/build/manifest.json
Steps To Reproduce
resources/js/app.js
andresources/sass/styles.scss