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
TypeScript error in .vue files: Cannot find name 'process' #1764
Comments
I investigated some more and it looks like this bug was introduced with version 0.38.7. |
I will look into making a minimal reproduction, but did you try it with a project generated by Vue CLI? |
I still haven't made a minimal reproduction, but I did get more information. The problem seems to only occur when you add the parent folder in Visual Studio Code. For example, like this:
After you do the above, if you add the "example" folder to Visual Studio Code then |
It may relate to #1679, please try v0.40.4 and let me know if it don't fix. |
The bug is still present in v0.40.4. Do you want an example repository or are the instructions I provided good enough? |
I fixed this by adding 'node' to the types in my tsconfig.json. After trying all the various webpack/define/process fixes I thought were the problem. |
For anyone reaching this thread today, if you're using Vite you need to change "types": [
"vite/client"
] |
I have a Vue project that was generated with Vue CLI. I have some
VUE_APP_*
variables that I access throughout my codebase by usingprocess.env.VUE_APP_*
. This works fine, but recently Visual Studio Code started showing an error forprocess
in my .vue files. When I hover over it, this is what it says:npm run serve
doesn't show an error and the code works in the browser. In addition,process.env.VUE_APP_*
works fine in .js and .ts files (Visual Studio Code doesn't report any errors withprocess
and I can hover over it and it showsNodeJS.Process
for its type). This also only happens with Volar. When I open the exact same codebase with Vetur instead of Volar, it works fine.The text was updated successfully, but these errors were encountered: