fix: manually register Stimulus controllers in bootstrap.js

Auto-discovery may not work reliably with vite-plugin-symfony.
Explicit registration ensures dropdown, notifications, and
import-modal controllers are loaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-03-29 23:14:16 +02:00
parent 23c291d2c2
commit f42a3ba286

6
assets/bootstrap.js vendored
View File

@@ -1,6 +1,12 @@
import { startStimulusApp } from 'vite-plugin-symfony/stimulus/helpers'; import { startStimulusApp } from 'vite-plugin-symfony/stimulus/helpers';
import DropdownController from './controllers/dropdown_controller.js';
import NotificationsController from './controllers/notifications_controller.js';
import ImportModalController from './controllers/import_modal_controller.js';
const app = startStimulusApp(); const app = startStimulusApp();
app.register('dropdown', DropdownController);
app.register('notifications', NotificationsController);
app.register('import-modal', ImportModalController);
// Register React components for {{ react_component() }} Twig function. // Register React components for {{ react_component() }} Twig function.
// We register them manually because @symfony/ux-react's registerReactControllerComponents // We register them manually because @symfony/ux-react's registerReactControllerComponents