Bug description
I have a simple NavItem in my CP that just calls the route: the route does something, sends a "success" toast, and returns:
public function __invoke()
{
// do some things
Toast::success('Success!');
return Inertia::back();
}
However, a JS error is thrown, and an empty array is send back as the Toast, resulting in the console error:
Uncaught TypeError: this[type] is not a function
The props for _toasts looks like:
How to reproduce
- Create a new Statamic site
- Create a simple CP controller (Controller file, and the route), and use the
__invoke method above
- Add a Nav item via the AddonServiceProvider
- Visit the route in the CP
Logs
Environment
Environment
Laravel Version: 13.14.0
PHP Version: 8.4.22
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file
Storage
public/storage: NOT LINKED
Livewire
Livewire: v4.3.1
Statamic
Addons: 0
License Key: Not set
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.20.2 PRO
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Bug description
I have a simple NavItem in my CP that just calls the route: the route does something, sends a "success" toast, and returns:
However, a JS error is thrown, and an empty array is send back as the Toast, resulting in the console error:
The props for
_toastslooks like:How to reproduce
__invokemethod aboveLogs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response