fix: use vite-plugin-symfony Stimulus loader and wrap react_component in div
Some checks failed
Build and Push Docker Images / Build app image (push) Failing after 17s
Build and Push Docker Images / Build database image (push) Successful in 8s
Build and Push Docker Images / Build node image (push) Failing after 17s

The @symfony/stimulus-bundle loader generates an empty controllers.js,
so Stimulus controllers from controllers.json (including ux-react) were
never registered. Switching to vite-plugin-symfony/stimulus/helpers
uses the virtual:symfony/controllers module that properly reads
controllers.json. Also wrap react_component() output in a <div> since
it only renders data-attributes, not a full HTML element.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-03-28 15:02:27 +01:00
parent ae9b0fdba7
commit 9cb5c6e2a5
8 changed files with 68 additions and 26 deletions

View File

@@ -15,6 +15,8 @@
"react-dom": "^19.0"
},
"devDependencies": {
"@symfony/stimulus-bridge": "^3.2.0 || ^4.0.0",
"@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets",
"@vitejs/plugin-react-swc": "^4.3.0",
"vite": "^6.0",
"vite-plugin-symfony": "^8.0"