Closed gunters63 closed 3 years ago
I'm gonna get some tests going before I publish my suspected fix.
Okay, try out 3.3.6 in your project. :)
If that fails, please write a failing test (here) and open a PR. 👍
To run tests locally:
git clone https://github.com/aleclarson/vite-tsconfig-paths
cd vite-tsconfig-paths
pnpm install
yarn test --watch -i
I still get a crash with 3.3.6, in a different place.
After executing the line:
projectPath = resolve(root, vite_1.normalizePath(projectPath))
projectPath is "D:\\proj\\AtlasCopco\\EnsoUi/D:/proj/AtlasCopco/EnsoUi/tsconfig.json"
The posix.resolve call gets correct parameters it seems:
import { posix } from 'path'
const { join, resolve } = posix
Pretty sure these posix Node api calls do not work on Windows
Follow the instructions in Troubleshooting, and paste the logs here.
You can also write a failing test here and open a PR with it (no fix necessary).
git clone https://github.com/aleclarson/vite-tsconfig-paths
cd vite-tsconfig-paths
pnpm install
yarn test --watch -i
@gunters63 What options are you passing to the plugin?
Okay, I see what you mean about the path.posix
incompatibility. Working on a fix!
Windows paths should be fixed in v3.3.7
And include
bugs are fixed in v3.3.8
I can confirm 3.3.8 is working again :)
What I didn't understand in the fix is the need to detect the OS manually, for example calling path.win32.resolve on Windows and path.posix.resolve on other platforms. Wouldn't just calling path.resolve work?
Wouldn't just calling path.resolve work?
win32.resolve
converts /
to \\
, and the plugin internals expect /
separators only
Updating from 3.3.2 to 3.3.3 breaks dev server and build with the following error:
I am using Windows and Node 14 LTS. I guess some recent changes broke path handling on Windows.