vanilla-extract-css / vanilla-extract

Zero-runtime Stylesheets-in-TypeScript
https://vanilla-extract.style
MIT License
9.51k stars 287 forks source link

@vanilla-extract/vite-plugin@4.0.4 hangs Vite build #1408

Open emondpph opened 4 months ago

emondpph commented 4 months ago

Describe the bug

I am experiencing an issue upgrading the @vanilla-extract/vite-plugin to version 4.

It seems the commit in 4.0.4 creates an issue on my end where Vite build will succeed (generated CSS is OK) but the Vite process itself does not close. I need to force close the Vite process (CTRL-C)

The release which seems to be problematic on my end: https://github.com/vanilla-extract-css/vanilla-extract/releases/tag/%40vanilla-extract%2Fvite-plugin%404.0.4

This bug was not happening in version 3.9 or 4.0.3.

Reproduction

.

System Info

System:
    OS: macOS 13.5.2
    CPU: (12) arm64 Apple M2 Pro
    Memory: 210.06 MB / 16.00 GB
    Shell: Unknown - /bin/ksh
  Binaries:
    Node: 18.18.0 - /opt/homebrew/opt/node@18/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.8.1 - /opt/homebrew/opt/node@18/bin/npm
    bun: 1.0.7 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 124.0.6367.119
    Safari: 16.6
  npmPackages:
    vite: ^5 => 5.2.11

Used Package Manager

npm

Logs

No response

Validations

emondpph commented 4 months ago

I seem to be able to fix the hanging by adding line 105 within the code of the vite-plugin. My Vite configuration is having two plugin: @rollup/plugin-typescript (for generating DTS files) and Vanilla Extract.

Not sure what is happening here...

Capture d’écran, le 2024-05-04 à 23 53 53

askoufis commented 4 months ago

Usually when you tick the box that says The provided reproduction is a minimal reproducible example of the bug, you provide some sort of minimal reproduction.

I have made a repo with my own reproduction.

emondpph commented 4 months ago

Hey @askoufis, sorry about that. It was late and I focused more on finding the issue in the vite-plugin code and which version the problem started to appear. Thanks for creating the repo with reproduction.

I can tell that this seems to be an incompatiblity with @rollup/plugin-typescript, but the why I'm not sure.

Replacing @rollup/plugin-typescript with https://github.com/qmhc/vite-plugin-dts also fixes the hanging.

gkiely commented 2 months ago

I'm also running into this issue, it's causing another plugin to hang. 3.9.5 is the last working version.

NHNkimjaemin commented 2 months ago

Any updates on this? Same issue here and downgrading to 4.0.3 solved this.

dadajam4 commented 2 weeks ago

I am facing the same issue. I am avoiding it by fixing the version to 3.9.5.

MatthijsBon commented 1 week ago

Is there any progress here?