Unable to run vue-tsc after running ts-patch install -s
Vue - Official extension or vue-tsc version
2.1.4
VSCode version
Vue version
TypeScript version
5.5.4
System Info
System:
OS: Windows 11 10.0.22631
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Memory: 10.62 GB / 31.73 GB
Binaries:
Node: 20.5.1 - C:\Program Files\nodejs\node.EXE
npm: 9.8.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (127.0.2651.74)
Internet Explorer: 11.0.22621.3527
package.json dependencies
{
"type": "module",
"scripts": {
"prepare": "ts-patch install -s",
"vue-tsc": "vue-tsc"
},
"devDependencies": {
"ts-patch": "3.2.1",
"vue-tsc": "2.1.4"
}
}
Steps to reproduce
- Copy
package.jsonto some directory. - Run
npm i. - Run
npm run vue-tsc.
What is expected?
It works.
What is actually happening?
I get the following error:
.\node_modules\vue-tsc\index.js:56
throw err;
^
TypeError: Cannot read properties of undefined (reading 'useCaseSensitiveFileNames')
at Object.proxyCreateProgram (.\node_modules\@volar\typescript\lib\node\proxyCreateProgram.js:33:68)
at .\node_modules\typescript\lib\tsc.js:552:153
at .\node_modules\typescript\lib\tsc.js:606:7
at Object.<anonymous> (.\node_modules\typescript\lib\tsc.js:627:3)
at Module._compile (node:internal/modules/cjs/loader:1233:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
Node.js v20.5.1
Process finished with exit code 1
Link to minimal reproduction
No response
Any additional comments?
I wanted to write a TS plugin using ts-patch which would exclude some declaration files from being emitted when running vue-tsc. After I installed ts-patch, vue-tsc stopped working and I got this error.
I have the same issue, were you able to find a solution?
I found another solution for the underlying issue I was using ts-patch to try to resolve. I did not look into this further ever since.
I'm using it for typia, and I can't seem to find an alternative.
For people who are bundling their code, unplugin-typia is a more convenient alternative to ts-patch that doesn't interfere with other tools using tsc.
For people who are bundling their code, unplugin-typia is a more convenient alternative to ts-patch that doesn't interfere with other tools using tsc.
@zareith You still need to install typia which requires ts-patch ..
You still need to install typia which requires ts-patch ..
@sgpinkus That doesn't matter if you don't configure it to patch the ts compiler dependency in your project.
If you have configured ts patch in your project in past you will need to remove and do a clean install of dependencies. It works fine after that.
In the setup docs for typia there is the step npx typia setup. This installs ts-patch and applies the patch. AFAIK that step is not optional.
@sgpinkus It is optional.
Just run npx typia setup command if you’re using tsc. The setup wizard will do everything.
Note the part about "if using tsc". If you use another bundler and typia integration for said bundler, you don't need the typia setup step.
Erm, no I don't think your correct here.
Cannot reproduce anymore with v3. Please open a new issue with a minimal reproduction if it still happens.