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

@vanilla-extract/vite-plugin v4.0.4 does not work in vitest on windows #1321

Closed
2 tasks done
kasper573 opened this issue Feb 11, 2024 · 2 comments
Closed
2 tasks done
Labels
bug Issue is caused by a bug in a Vanilla Extract package vite Issue related to vite

Comments

@kasper573
Copy link

kasper573 commented Feb 11, 2024

Describe the bug

Hello! I just upgraded my project from using the vite-plugin v3.9.2 to the new v4.0.4. It works great in vite dev mode and building for production. It also works great in vitest in the CI (where I use ubuntu-latest). However, in my local dev environment Windows 11 my test suite fails (see logs below). I created a repro in the linked repository where I have set up a CI that runs a simple vitest with vanilla extract on windows-latest, ubuntu-latest and macos-latest, and as you can see it fails specifically on windows-latest. This used to work on Windows when I used v3.9.2, so it seems like a regression.

Reproduction

https://github.com/kasper573/vitest-vanilla-extract-v4-plugin-windows-bug/actions/runs/7865213527

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 11.88 GB / 31.92 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.1 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (121.0.2277.112)
    Internet Explorer: 11.0.22621.1

Used Package Manager

npm

Logs

Run npm run test

> vitest-vanilla-extract-v4-plugin-windows-bug@0.0.0 test
> vitest


 RUN  v1.2.2 D:/a/vitest-vanilla-extract-v4-plugin-windows-bug/vitest-vanilla-extract-v4-plugin-windows-bug

 ❯ test/integration.test.ts  (0 test)
⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/integration.test.ts [ test/integration.test.ts ]
Error: No CSS for file: /test/styles.css.ts
 ❯ Object.getCssForFile node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.dev.js:840:15
 ❯ Context.resolveId node_modules/@vanilla-extract/vite-plugin/dist/vanilla-extract-vite-plugin.cjs.dev.js:157:79
 ❯ Object.resolveId node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:50743:64
 ❯ ModuleGraph._resolveUrl node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:64127:46
 ❯ async file:/D:/a/vitest-vanilla-extract-v4-plugin-windows-bug/vitest-vanilla-extract-v4-plugin-windows-bug/node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:64029:45
 ❯ ModuleGraph.updateModuleInfo node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:63969:13
 ❯ TransformContext.transform node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:65876:39
 ❯ Object.transform node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:50819:30
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:53592:29

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯


 Test Files  1 failed (1)
      Tests  no tests
   Start at  22:53:32
   Duration  1.03s (transform 49ms, setup 0ms, collect 0ms, tests 0ms, environment 0ms, prepare 158ms)

Validations

@askoufis askoufis added vite Issue related to vite bug Issue is caused by a bug in a Vanilla Extract package and removed pending triage labels Feb 12, 2024
@askoufis
Copy link
Contributor

askoufis commented Mar 9, 2024

This has been fixed by #1346, available in v4.0.6 of the vite plugin.

@askoufis askoufis closed this as completed Mar 9, 2024
@kasper573
Copy link
Author

I can confirm that it works on my end. Great work, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is caused by a bug in a Vanilla Extract package vite Issue related to vite
Projects
None yet
Development

No branches or pull requests

2 participants