You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In new Vite project, there is .eslintrc.cjs file with __dirname used there. If tsc is called from CLI, there is no problem but the IDE service reports this __dirname usage as error.
I have tried every step that came to my mind (including installing @types/node and adding types: ["node"] to tsconfig.json compilerOptions) to solve this without using // @ts-ignore, but failed everytime.
This issue occurs even without extensions.
VS Code Version: 1.80.1
OS Version: Windows 11 (22621.1992) with WSL2 - Ubuntu 22.04.2 LTS
Steps to Reproduce:
run npm create vite@latest
choose "typescript + swc" template
check the .eslintrc.cjs file and look how __dirname error is reported
The text was updated successfully, but these errors were encountered:
I just ran into it this morning, appears to be a Vite issue, not TS.
Check vitejs/vite#13749 for the PR status, or copy the settings manually for an immediate fix
@jakebailey Yes, I have done that, but the issue is still there.
Even after reloading VS Code window, no change at all.
@drewhoener This is happening on all of my projects, and some of them are not based on Vite. I just chose the Vite template as a good example. And because running tsc via CLI gives no actual error, I highly suspect the VS Code IDE.
@ts-ignoring "fixes" this but, I would really like to know where is the problem. Can't figure it out.
In new Vite project, there is .eslintrc.cjs file with
__dirname
used there. Iftsc
is called from CLI, there is no problem but the IDE service reports this__dirname
usage as error.I have tried every step that came to my mind (including installing @types/node and adding types: ["node"] to tsconfig.json compilerOptions) to solve this without using // @ts-ignore, but failed everytime.
This issue occurs even without extensions.
Steps to Reproduce:
npm create vite@latest
.eslintrc.cjs
file and look how__dirname
error is reportedThe text was updated successfully, but these errors were encountered: