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-yarn-workspace-typescript-definition-problem #1717

Open
3 tasks done
mariusheine opened this issue Feb 17, 2020 · 3 comments
Open
3 tasks done

vetur-yarn-workspace-typescript-definition-problem #1717

mariusheine opened this issue Feb 17, 2020 · 3 comments

Comments

@mariusheine
Copy link

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

Info

  • Platform: Win
  • Vetur version: 0.23.0
  • VS Code version: 1.42.0
  • Typescript: 3.7.5

Problem

When i use yarn workspaces and import something from inside the script tag of a sfc vue component and i want to go to the definition of the import i get to the *.d.ts file in the dist folder. But when i import the same thing in a "normal" file e.g. main.ts and go to definition i get to the .ts file in the src folder.

In the mouseover the resolved path for the imported module is the same in both cases so i think the differences is that in the second case it follows the sourceMappingURL and in the first one not

Reproducible Case

Clone this repo https://github.com/mariusheine/vetur-yarn-workspace-typescript-definition-problem and follow the README.

Then open App.vue and main.ts and try "Go To Definition of any import of @vetur-yarn-workspace-typescript-definition-problem/domain.

@yshrsmz
Copy link

yshrsmz commented Apr 10, 2020

Maybe it's not 100% the same issue, but I'm also seeing an issue regarding yarn workspaces and typescript.

In my case, Vetur does not respect types configured in a tsconfig in a workspace.

For example, I'm using Nuxt in one of the workspaces and added @nuxt/types like below.

// packages/workspace-a/tsconfig.json
{
  "compilerOptions": {
    "types": "types": ["@types/node", "@nuxt/types"]
  }
}

(only this workspace-a has a dependency to Nuxt)

But Vetur seems to not recognize this and show warnings when I try to use methods added by @nuxt/types, such as asyncData

btw it does compile successfully

@yshrsmz
Copy link

yshrsmz commented Apr 10, 2020

Whoops, looks like my real issue is #815

@heavenkiller2018
Copy link

any updates?

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

No branches or pull requests

4 participants