SPA mode: Component not found
Package
filament/filament
Package Version
v3.3.20
Laravel Version
v12.17.0
Livewire Version
v3.6.3
PHP Version
PHP 8.3.21
Problem description
If you use the SPA mode in Filament, this error sometimes occurs when changing pages:
store.js:37 Uncaught Component not found: nGaBvpP50W3YoIRMSCg0
os @ store.js:37
(anonymous) @ component.js:146
get children @ component.js:146
Xa @ supportPropsAndModelables.js:88
Ga @ supportPropsAndModelables.js:66
(anonymous) @ supportPropsAndModelables.js:9
(anonymous) @ supportPropsAndModelables.js:6
P @ hooks.js:53
createAndSendNewPool @ bus.js:64
(anonymous) @ bus.js:38
(anonymous) @ bus.js:137
setTimeout
Lc @ bus.js:136
add @ bus.js:32
Qo @ index.js:31
(anonymous) @ $wire.js:237
It @ module.esm.js:527
(anonymous) @ module.esm.js:515
Il @ module.esm.js:425
Ee @ module.esm.js:454
(anonymous) @ wire-init.js:7
(anonymous) @ directives.js:23
P @ hooks.js:53
(anonymous) @ lifecycle.js:86
(anonymous) @ lifecycle.js:85
(anonymous) @ module.esm.js:1251
(anonymous) @ module.esm.js:814
(anonymous) @ module.esm.js:814
Oe @ module.esm.js:725
Oe @ module.esm.js:730
Oe @ module.esm.js:730
Oe @ module.esm.js:730
Oe @ module.esm.js:730
Oe @ module.esm.js:730
Oe @ module.esm.js:730
Oe @ module.esm.js:730
Oe @ module.esm.js:730
Oe @ module.esm.js:730
(anonymous) @ module.esm.js:810
Hl @ module.esm.js:607
ie @ module.esm.js:809
Ra @ index.js:227
(anonymous) @ index.js:113
(anonymous) @ index.js:209
The page cannot be loaded then, and neither can any other pages. It is always the same component ID in the errors.
Expected behavior
The page should load as expected.
Steps to reproduce
- Enable SPA mode in Filament.
- Switch between pages and at some point the error should happen. I don't know if time has to pass in between.
I don't do anything unusual in Filament, just normal tables (no matter if polling, it can happen on any page), so I think the demo should be enough to reproduce.
Reproduction repository (issue will be closed if this is not valid)
https://github.com/filamentphp/demo
Relevant log output
Can you please try to work out reproduction conditions for the error? Nothing is truly a "random" failure
@danharrin It's not really reproducible I think, it really just happens out of nowhere, sometimes not at all for a long time. Most of the time everything works, it's rather a rare error.
Maybe it would be helpful to find out which component cannot be found, should I debug something?
Does it occur during development? you change something in the code and then it happens? I don't think it ever happened on production.
Does it occur during development? you change something in the code and then it happens? I don't think it ever happened on production.
It actually only occurs in production and without me doing anything in the code.
@danharrin Just tried clicking around one of my apps for ~1 minute and couldn't reproduce this.
@robinmiau I run all my apps in SPA mode and haven't run into this before. Are you sure the problem is caused by SPA mode? In my experience component not found errors are usually caused by something else eg: https://github.com/filamentphp/filament/issues/16523.
Unfortunately there's not much that can be done without a proper reproduction repository. You'll need to investigate further. Start by keeping track of exactly what you're clicking on to trigger this. That'll narrow down the cause. Then create a reproduction repo with detailed steps that reproduces the problem.