-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vitest does not work with ${configDir}
and references
of tsconfig.json
#7420
Comments
I think Vite also fails, so either an upstream bug or invalid usage. How can I confirm tsc supports this Vite internally uses tsconfck and it appears to have (Created an upstream issue dominikg/tsconfck#210) |
Thank you for giving a look.
I have adapted the Stackblitz: https://stackblitz.com/edit/github-jbcdpwek-1nnhrvjc?file=ts-config.vi-configdir.json |
added a fix for this in [email protected], which still needs to land in vite. This might not 100% fix it in vitest as it is also using get-tsconfig here:
|
Thank you. It is used only if "typecheck" is enabled from what I saw. However, could be worth to check with "typecheck" enabled indeed. |
Describe the bug
It seems that
${configDir}
is not recognized by vitest when used throughreferences
oftsconfig.json
.Reproduction
https://github.com/Lukinoh/repro-configdir-bug-vitest/
Steps to reproduce
git clone [email protected]:Lukinoh/repro-configdir-bug-vitest.git
cd repro-build-watch-vite-plugin-dts
npm install
npm run test
// Everything works heretsconfig.json
/
at line 5npm run test
// 💥, it does not workAdditional details
To highlight the issue, I added a library that uses
experimentalDecorators
.It allows me to detect whether the correct
tsconfig.json
is used or not.If there is an error, it means that
experimentalDecorators
isfalse
.Hence, it is not using the
compilerOptions
oftsconfig.vi-XXX.json
.I suspect that something is not able to correctly interpret the
${configDir}
when used in conjunction withreferences
of thetsconfig.json
.If I rename
tsconfig.vi-configdir.json
totsconfig.json
, it works.System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: