Skip to content
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

Vite Plugin does not work correctly on Windows #385

Open
rsi-dwieser opened this issue Feb 24, 2025 · 0 comments
Open

Vite Plugin does not work correctly on Windows #385

rsi-dwieser opened this issue Feb 24, 2025 · 0 comments
Assignees
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite

Comments

@rsi-dwieser
Copy link

rsi-dwieser commented Feb 24, 2025

Steps to reproduce

Take any working vite/pigment configuration and attempt to run vite:serve on windows. It will not work (application does not load)

Current behavior

Vite/Pigment build & serve broken on Windows

Expected behavior

Vite/Pigment build & serve should function on Windows in the same way as Mac, Linux

Context

We have a vite configuration for pigment which runs perfectly on Mac (and presumably Linux) but is entirely broken when run on Windows.

I have traced the issue to this line, which is using an OS-based path.sep.

  const finalTransformLibraries = allLibs.map((lib) => lib.split('/').join(path.sep));

This is causing the transform libraries to be parsed like this.

'@mui\\material',
 '@pigment-css\\react',
 '@mui\\material-pigment-css'

And as such imports of these libraries are not correctly matched and processed during the build process.

Is the expectation that the transform libraries may be a combination of direct paths that need to adjust per OS and npm imports which will not change separators? Or could this separator safely always be "/"?

Your environment

npx @mui/envinfo
  System:
    OS: Windows 11 10.0.22631
  Binaries:
    Node: 20.17.0 - C:\Program Files (x86)\nodejs\node.EXE
    npm: 10.8.2 - C:\Program Files (x86)\nodejs\npm.CMD
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
    Edge: Chromium (127.0.2651.74)
  npmPackages:
    @emotion/react: 11.14.0 => 11.14.0
    @emotion/styled: 11.14.0 => 11.14.0
    @mui/core-downloads-tracker:  6.4.4
    @mui/icons-material: 6.4.4 => 6.4.4
    @mui/material: 6.4.4 => 6.4.4
    @mui/material-pigment-css: 6.4.3 => 6.4.3
    @mui/private-theming:  6.4.3
    @mui/styled-engine:  6.4.3
    @mui/system:  6.4.3
    @mui/types:  7.2.21
    @mui/utils:  6.4.3
    @pigment-css/react: 0.0.30 => 0.0.30
    @pigment-css/vite-plugin: 0.0.28 => 0.0.28
    @types/react: 19.0.8 => 19.0.8
    react: 19.0.0 => 19.0.0
    react-dom: 19.0.0 => 19.0.0
    typescript: 5.7.3 => 5.7.3

Search keywords: windows, vite

@rsi-dwieser rsi-dwieser added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 24, 2025
@zannager zannager added the vite label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite
Projects
None yet
Development

No branches or pull requests

3 participants