vanilla-extract-css / vanilla-extract

Zero-runtime Stylesheets-in-TypeScript

Home Page:https://vanilla-extract.style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

emondpph opened this issue · comments

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

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

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.

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.