Skip to content

Inconsistent behaviour between .ts and .vue imports from referenced project #4516

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

Closed
PindaPixel opened this issue Jul 1, 2024 · 3 comments
Closed

Comments

@PindaPixel
Copy link

Vue - Official extension or vue-tsc version

v2.0.24

VSCode version

1.90.2

Vue version

3.4.31

TypeScript version

5.5.2

System Info

No response

Steps to reproduce

  1. See reproduction repository
  2. Open App.web.test.ts
  3. Notice that it can import from ./index, but not from ./App.vue, while they come from the same referenced project tsconfig.app.json
    image

Link to minimal reproduction

https://github.com/PindaPixel/vue-tsconfig-paths

Any additional comments?

I do not know for certain whether it should be able to import App.vue or should not be able to import from ./index, but to me it seems that at the very least it should be consistent between the two.

@PindaPixel PindaPixel changed the title Inconsistent behaviour between imports from referenced project Inconsistent behaviour between .ts and .vue imports from referenced project Jul 1, 2024
@davidmatter
Copy link
Collaborator

The issue here is that you only include ['**/*.web.test.ts'] in tsconfig.web.test.json. In the tsconfig that should cover the testing context, you should add all your source files so typescript can actually resolve your types.

Use https://github.com/vuejs/create-vue to create a project with a well-defined base structure.

@PindaPixel
Copy link
Author

PindaPixel commented Jul 1, 2024

The issue here is that you only include ['**/*.web.test.ts'] in tsconfig.web.test.json. In the tsconfig that should cover the testing context, you should add all your source files so typescript can actually resolve your types.

Use https://github.com/vuejs/create-vue to create a project with a well-defined base structure.

This still doesn't explain the inconsistent behaviour to me though. Also what else is the references for?

@davidmatter
Copy link
Collaborator

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

2 participants