TypeError: Ht.apply is not a function when using customButtons with a click handler #104
Unanswered
kennyhorna
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm having trouble implementing
customButtonswith a click handler in a Filament v4 widget. Despite ensuring all assets are loaded correctly and providing a valid function to the click property, the underlyingvkurko/calendarlibrary consistently throws a:Environment:
Minimal Reproducible Example (
VenueBookingControlWidget.php):This is the simplified widget code that still produces the error. The goal is for the custom buttons to call a Livewire method.
Troubleshooting Steps Taken:
Confirmed all CSS and JS assets (including
vendor/guava/calendar/resources/js/calendar.js) are correctly imported and bundled with Vite.Confirmed the widget's
FilamentAsset::register()and.viteTheme()setup is correct.The error persists even when the click handler is simplified to
RawJs::from("function() { alert('test'); }").The error occurs regardless of whether the click handler content is a simple string or a full function definition, suggesting an issue in how the options are processed.
It seems like the click property is not being correctly interpreted as a function by the time it reaches the
vkurko/calendarinitialization script. Any insight would be greatly appreciated.Thank you!
All reactions