Skip to content

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

Merged
Kocal merged 1 commit into
symfony:2.xfrom
Kocal:windows-vue-react-svelte-support
Jul 6, 2025
Merged

Kocal merged 1 commit into
symfony:2.xfrom
Kocal:windows-vue-react-svelte-support

Conversation

@Kocal

@Kocal Kocal commented Jul 1, 2025 •

Copy link
Copy Markdown
Member
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

Kocal commented Jul 2, 2025 •

Copy link
Copy Markdown
Member Author

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
@Kocal
Kocal merged commit 90ad404 into symfony:2.x Jul 6, 2025
@Kocal
Kocal deleted the windows-vue-react-svelte-support branch July 29, 2025 12:55
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