Widget error - unable to find component

I used the command line to create a stats-overview widget, Enrollment. I did not create it tied to any resource and it's for the admin panel, the only panel I have. As expected, app/Filament/Widgets/Enrollment.php was created. I manually changed the file and class name to EnrollmentWidget (to avoid a name conflict with the Model), changed the getHeadersWidgets function in the Dashboard page, and emptied out the auto-discover and widget arrays in the config file. But when I load the Dashboard, I get an error: Unable to find component: [app.filament.widgets.enrollment-widget] Is this expecting a view I have not provided? Is it connected to the originally-named widget?
Solution:
Or register it with the panel through ->widgets()
Jump to solution
3 Replies
awcodes
awcodes11mo ago
If you emptied the auto discovery you have to register it manually or move it to the Livewire directory.
Solution
awcodes
awcodes11mo ago
Or register it with the panel through ->widgets()
gmgarrison
gmgarrisonOP11mo ago
Oooh. Interesting. I added it back to the panel with ->widgets() and it was there twice so I removed it from the Dashboard's getHeaderWidgets() and now I'm back to what I want. So even though I've got a Dashboard Page, I should just use the AdminPanelProvider to configure Widgets that I want on the Dashboard because they have to be in the Provider regardless but they don't need to be in the getHeaderWidgets() in order to be displayed. Thanks a lot!!!!
Want results from more Discord servers?
Add your server