Skip to content
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

Vetur ignoring tsconfig.json from project when running VSCode in workspace mode #687

Closed
3 tasks done
TheAkio opened this issue Feb 9, 2018 · 8 comments
Closed
3 tasks done

Comments

@TheAkio
Copy link

TheAkio commented Feb 9, 2018

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Linux
  • Vetur version: 0.11.7
  • VS Code version: 1.20

Problem

Vetur ignores tsconfig.json in project (or at least the experimentalDecorators option) when running VSCode in workspace mode.

Reproducible Case

I used the nuxt TypeScript template from here and had the folder open in a workspace. I was simply getting this error message on decorators: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

After some time i figured I might try without using the workspace so I opened the project directly and the error was gone. In addition I also tried placing the same tsconfig.json in the workspace directory which also worked.

I think vetur has no proper VSCode workspace functionality yet for finding the tsconfig.json.

Related issues

#567
nuxt-community/typescript-template#5

@jkehler
Copy link

jkehler commented Feb 20, 2018

I'm experiencing the same problem. If I just load up my project without a workspace everything works as expected. But the moment I load up my Vue project inside a workspace Vetur is not using the tsconfig.json file from the project.

@octref
Copy link
Member

octref commented Mar 6, 2018

This is tracked in #424

@octref octref closed this as completed Mar 6, 2018
@chris-dura
Copy link

@TheAkio How do you "place the same tsconfig.json in the workspace directory"?

@TheAkio
Copy link
Author

TheAkio commented Apr 24, 2018

@chris-dura You copy the tsconfig.json from your project directory and paste it into your workspace directory. A symlink might work too but I didn't test it. Basically there needs to be a tsconfig.json in your workspace directory too until this is fixed.

@chungweileong94
Copy link

chungweileong94 commented Apr 25, 2018

@TheAkio it does fix the problem, but at the same time, it no longer recognize the "@/components/HelloWorld.vue" file in the import statement
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src

@TheAkio
Copy link
Author

TheAkio commented Apr 26, 2018

@chungweileong94 I guess we might just have to use VSCode without multi-root-workspace when working on such applications.

@squalsoft
Copy link

I have the same issue and i found little workaround in a workspace mode! If you place your nuxt/frontend project on the top of workspaces tree then Vetur obviously read tsconfig from this first workspace and everything works without warnings/errors in .vue files.

@flytomek
Copy link

flytomek commented May 9, 2019

@squalsoft That's a great workaround. I was facing the same issue - after generating Vue project using CLI, Vetur was giving me 2 errors:
Cannot find module '@/components/HelloWorld.vue'
and
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

Opening my fresh Vue project in first workspace made error disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants