Vite plugin 4.0 doesn't work with tsconfig paths
jabrks opened this issue · comments
James Brooks commented
Describe the bug
After upgrading to the latest version of the Vite plugin, any imports that rely on the paths
option defined in tsconfig.json using vite-tsconfig-paths no longer resolve
Reproduction
https://stackblitz.com/edit/remix-run-remix-tc8hp2?file=app%2Fstyles%2Findex.css.ts
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.14.0 - /usr/local/bin/pnpm
npmPackages:
@vanilla-extract/css: ^1.14.1 => 1.14.1
@vanilla-extract/vite-plugin: ^4.0.0 => 4.0.0
vite: ^5.0.12 => 5.0.12
Used Package Manager
npm
Logs
[vite] Internal server error: Failed to load url ~/styles/vars.css (resolved id: ~/styles/vars.css) in /home/projects/remix-run-remix-tc8hp2/app/styles/index.css.ts. Does the file exist?
Plugin: vanilla-extract
File: /home/projects/remix-run-remix-tc8hp2/app/styles/index.css.ts
at loadAndTransform (/home/projects/remix-run-remix-tc8hp2/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:49777:21)
at async ViteNodeServer._transformRequest (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/server.mjs:426:16)
at async ViteNodeServer._fetchModule (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/server.mjs:396:17)
at async ViteNodeRunnerWithContext.directRequest (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/client.mjs:267:46)
at async ViteNodeRunnerWithContext.cachedRequest (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/client.mjs:206:14)
at async ViteNodeRunnerWithContext.dependencyRequest (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/client.mjs:250:12)
at async eval (/home/projects/remix-run-remix-tc8hp2/app/styles/index.css.ts:4:31)
at async ViteNodeRunnerWithContext.runModule (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/client.mjs:379:5)
at async ViteNodeRunnerWithContext.directRequest (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/client.mjs:363:5)
at async ViteNodeRunnerWithContext.cachedRequest (/home/projects/remix-run-remix-tc8hp2/node_modules/vite-node/dist/client.mjs:206:14)
Validations
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
James Brooks commented
Ah, it looks like #1295 was opened as I was writing this 😅