Open simonhamp opened 1 week ago
Run php artisan filament:assets
manually.
Doing this in your repo app loads them correctly on the 404.
@awcodes i haven't tried this yet, but can you enlighten me as to why this works?
Feels really strange to me to have separate behaviour.
Package
filament/filament
Package Version
v3.2.116
Laravel Version
v11.27.1
Livewire Version
v3.5.6
PHP Version
v8.3.11
Problem description
My error page template is customised so that it's not the standard Laravel 404 page. It's set to use my main
layouts/app.blade.php
and the page renders using this layout.This layout includes
@filamentStyles
and@filamentScripts
with the intention being to make use of some Filament components on the page, but when I hit a non-existent page,@filamentScripts
fails to load any scripts needed for Filament to operate - they also 404.If I swap it to use
@livewireScripts
, everything works.So it looks like the
@filamentScripts
tag is preventing loading of these assets on a 404 somehow.Expected behavior
I expect Livewire, Alpine and Filament scripts to be available to my page whether it's 404 or not.
Steps to reproduce
Create a
errors/404.blade.php
file that includes@filamentScripts
, then visit a URL that isn't handled by a route in your application. See that the necessary<script>
tags rendered but result in a 404 header and aren't loaded.Swap
@filamentScripts
for@livewireScripts
and note that the behaviour is different.Reproduction repository (issue will be closed if this is not valid)
https://github.com/simonhamp/filament-scripts
Relevant log output
No response
Donate 💰 to fund this issue