vanilla-extract icon indicating copy to clipboard operation
vanilla-extract copied to clipboard

Vite plugin not working with monorepo on Windows

Open mc-petry opened this issue 1 year ago • 1 comments

Describe the bug

@vanilla-extract/[email protected] not working in monorepo setup. Oldest version 3.1.4 works.

It seems that

  const getAbsoluteVirtualFileId = (source: string) => normalizePath(path.join(config.root, source));

not working in a right way on windows os.

Fast change to:

  const getAbsoluteVirtualFileId = (source: string) => source.startsWith('..')
    ? normalizePath(path.join(config.root, source))
    : source.startsWith('/@id/') ? source.substring(5) : source

fixes build but breaks HMR.

Reproduction

https://github.com/mc-petry/vanilla-extract-monorepo/tree/vite-plugin-regression

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 AMD Ryzen 3 5300U with Radeon Graphics
    Memory: 2.24 GB / 15.35 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (103.0.1264.77)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @vanilla-extract/vite-plugin: 3.3.0 => 3.3.0
    vite: ^3.0.5 => 3.0.5

Used Package Manager

pnpm

Logs

No response

Validations

mc-petry avatar Aug 10 '22 21:08 mc-petry

I have the same issue, still not updating since 3.1.4 is the latest version that works when you have to bundle .css.ts files from the app side.

Is the /@id/ check related of how pnpm resolve the packages paths 🤔?

riccardoperra avatar Aug 12 '22 09:08 riccardoperra