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

Error when importing vue components from a library in astro component #10564

Closed
1 task
mariolang-schmalz opened this issue Mar 26, 2024 · 1 comment
Closed
1 task
Labels
needs triage Issue needs to be triaged

Comments

@mariolang-schmalz
Copy link

Astro Info

Astro                    v4.5.9
Node                     v18.14.2
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/vue

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When importing a vue component inside of an astro component, the props and their types are being recognized correctly.
When importing a vue component directly from a dependency like a component library like primevue, the props are not being recognized correctly.

The following error occurs when trying to set a valid prop on a directly imported component from a library:
Type '{ link: true; }' is not assignable to type 'IntrinsicAttributes'. Property 'link' does not exist on type 'IntrinsicAttributes'.ts(2322)

---
import Button from 'primevue/button';
---

<Button link></Button>
{/*     ^^^^ */}

The local devserver works totally fine despite the error, but when trying to build the project and running astro check && astro build, the check fails with the following output:

> astro check && astro build

14:59:05 Types generated 117ms
14:59:05 [check] Getting diagnostics for Astro files in /home/ubuntu/temp/astro-vue-library-bug-reproduction...
src/pages/index.astro:18:17 - error ts(2322): Type '{ children: string; link: true; }' is not assignable to type 'IntrinsicAttributes'.
  Property 'link' does not exist on type 'IntrinsicAttributes'.

18         <Button link>Library button component</Button>
                   ~~~~

Result (3 files): 
- 1 error
- 0 warnings
- 0 hints

 ELIFECYCLE  Command failed with exit code 1.

What's the expected result?

The types of the component imported from a library should be recognized correctly, as if the component were a local file within my project

Link to Minimal Reproducible Example

https://stackblitz.com/~/github.com/mariolang-schmalz/astro-vue-library-bug-reproduction

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Mar 26, 2024
@Princesseuh
Copy link
Member

Duplicate of withastro/language-tools#649

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

No branches or pull requests

2 participants