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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: Vue types imported from monorepo package are not regonized #674

Open
minht11 opened this issue Oct 29, 2023 · 3 comments
Open
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: vue Related to the Vue integration (scope)

Comments

@minht11
Copy link

minht11 commented Oct 29, 2023

Describe the Bug

I have monorepo, with two packages one is vue components and other regular astro site. I use project references and so on. Importing regular ts/tsx files inside astro pages work as expected, but when I try importing any of my vue components, types are not resolved correctly. If i reexport vue components to index.ts and then import that, it shows that such export exists but types are empty. Actual vue component runs, just types are wrong.

Semi related to #649 but I don't do any bundling/dts emit so it is bit different.

Steps to Reproduce

  1. Setup monorepo with 2 packages. One vue components, other regular astro site.
  2. Try to import component from vue package, into astro site.
  3. Observe types being not recognized.
@Princesseuh
Copy link
Member

Any chance you could share a reproduction?

@Princesseuh Princesseuh added needs repro Issue needs a reproduction feat: vue Related to the Vue integration (scope) labels Oct 29, 2023
@minht11
Copy link
Author

minht11 commented Oct 29, 2023

You should be able reproduce issue here https://github.com/minht11/astro-monorepo-types-issue

@Princesseuh Princesseuh removed the needs repro Issue needs a reproduction label Oct 29, 2023
@minht11
Copy link
Author

minht11 commented Nov 5, 2023

I installed volar extension to see virtual files for vue components in design-system package and they are empty, because of this line

const integrationEditorEntrypoint =
framework === 'vue' ? importVueIntegration(filePath) : importSvelteIntegration(filePath);
if (!integrationEditorEntrypoint) {
const EMPTY_FILE = '';
return getVirtualFile(EMPTY_FILE);
}

As far as I understand astro resolves entry point for design-system not for site package, it doesn't find @astro/vue integration installed there so it returns empty file.

In fact if I add "@astrojs/vue": "^3.0.1" to design-system package.json it starts to work.

@Princesseuh Princesseuh added the - P3: minor bug An edge case that only affects very specific usage (priority) label Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: vue Related to the Vue integration (scope)
Projects
None yet
Development

No branches or pull requests

2 participants