question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Files starting with letter 't' breaks vite dev server on Windows

See original GitHub issue

Describe the bug

Running vite on a windows machine and having a file starting with the letter ‘t’ result in 404. In my example I’m using theme.css.ts, on mac this all works fine. However running the same example on Windows results in the following virtual file not found “http://localhost:3000/@id/project/srcheme.css.ts.vanilla.css?hash=xxx”. The problem here is tab \t is somewhere being cast to a tab, thus the correct url should be src/theme.css not srcheme.css. (Files starting with ‘s’ don’t cause any problems.)

I tried to debug (and fix) the issue, but thinking this is not a wonderfull solution 😅

How I managed to fix it 🙈

Replacing https://github.com/seek-oss/vanilla-extract/blob/master/packages/vite-plugin/src/index.ts#L23 const { fileName, source } = getSourceFromVirtualCssFile(id);

With const { fileName, source } = getSourceFromVirtualCssFile(id.replace(/\t/g, '\/t');

Happy to make a pr and follow advice.

Link to reproduction

Got an example repo, run yarn then yarn start on windows platform. https://bitbucket.org/Saartje87/vanilla-extract/src/master/

System Info

Output of npx envinfo --system --npmPackages @vanilla-extract/css,@vanilla-extract/webpack-plugin,@vanilla-extract/esbuild-plugin,@vanilla-extract/vite-plugin,@vanilla-extract/sprinkles,webpack,esbuild,vite --binaries --browsers:

  System:
    OS: Windows 10 10.0.19043
    CPU: (16) x64 Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz
    Memory: 5.90 GB / 15.83 GB
  Binaries:
    Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.7.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.964.0), Chromium (90.0.818.56)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    @vanilla-extract/css: ^0.4.3 => 0.4.3
    @vanilla-extract/sprinkles: ^0.2.2 => 0.2.2
    @vanilla-extract/vite-plugin: ^0.1.1 => 0.1.1
    vite: ^2.2.4 => 2.2.4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Saartje87commented, May 20, 2021

Sorry! My bad I’m guessing, somehow I managed to get another node_modules into vite-plugin folder and this was somehow locked. In my other playground repo I managed to lock it somehow else… Darn I did lookup the versions in node_modules/@vanilla-extract/*…

Everything works like a charm once I deleted my yarn.lock file and re-installed the modules. Thanks!!

0reactions
Saartje87commented, May 18, 2021

Yes!

How does vite plugin receive resolveId?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vite Issue Overview · Discussion #8232 · vitejs/vite - GitHub
Dev Server Performance. Persistent Cache Persistent Cache #1309; Proxy and HTTP2 ; Source Maps · TypeScript sourcemap doesn't have a "file" field #10311...
Read more >
Troubleshooting - Vite
Dev Server #. Requests are stalled forever #. If you are using Linux, file descriptor limits and inotify limits may be causing the...
Read more >
Change the output path for certain files during build - ViteJS
So, I think I need to change the input object but I can't find any information about it, I know about public directory...
Read more >
jYZ - River Thames Conditions - Environment Agency - GOV.UK
Symmetric data mean median mode, French cette plural, Rune server changing npc bits. ... only beyond this point, Rock bands that start with...
Read more >
Untitled
Flip hair in water, Presentation software for windows, Rue st hubert rimouski, ... Limonadier professionnel, Can't break an egg with one hand, Vinayak...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found