Skip to content

[Vue][React][Svelte] Fix components assets compilation on Windows server #2890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Jul 1, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #...
License MIT

Following #2816, this PR fixes the controller.js files generation when the Symfony app is running on Windows server:

Testing 
F...                                                                4 / 4 (100%)

Time: 00:01.229, Memory: 30.00 MB

There was 1 failure:

1) Symfony\UX\Vue\Tests\AssetMapper\VueControllerLoaderAssetCompilerTest::testCompileDynamicallyAddsContents
Failed asserting that 'import component_0 from '../../vue/controllers/MyVueController.js';\n
import component_1 from '../../vue/controllers/subdir/DeeperVueController.js';\n
export const components = {"MyVueController": component_0, "subdir\DeeperVueController": component_1};' contains ""subdir/DeeperVueController": component_".

D:\a\ux\ux\src\Vue\tests\AssetMapper\VueControllerLoaderAssetCompilerTest.php:72

I was able to set-up a Windows VM to ensure the PR fixes the problem (tip: don't use a remote VM in a train... 🙂)

Before, you can see that subfolder\Goodbye is interpreted as subfolderGoodbye, meaning that is not possible to use subfolder/Goodbye Vue component (I made a typo in the Twig template, but it has no effect):
Capture d’écran 2025-07-02 à 09 39 00
With the patch, the path now contains / instead of \, the component subfolder/Goodbye is now usable:
Capture d’écran 2025-07-02 à 09 58 07

@Kocal Kocal changed the title [Vue][React][Svelte] Fix controllers assets compilation on Windows se… [Vue][React][Svelte] Fix controllers assets compilation on Windows server Jul 1, 2025
@Kocal Kocal marked this pull request as draft July 1, 2025 21:00
@Kocal Kocal force-pushed the windows-vue-react-svelte-support branch from 28409d2 to ac9e9b5 Compare July 1, 2025 21:09
@Kocal Kocal marked this pull request as ready for review July 2, 2025 08:00
@Kocal Kocal requested review from kbond and smnandre July 2, 2025 08:01
@Kocal
Copy link
Member Author

Kocal commented Jul 2, 2025

I only tested Vue components btw, didn't have time for React and Svelte, the logic is the same

@Kocal Kocal changed the title [Vue][React][Svelte] Fix controllers assets compilation on Windows server [Vue][React][Svelte] Fix components assets compilation on Windows server Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants