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

Missing components type with vue-facing-decorator #4748

Closed
matteoscaramuzza opened this issue Aug 29, 2024 · 10 comments · Fixed by #4845
Closed

Missing components type with vue-facing-decorator #4748

matteoscaramuzza opened this issue Aug 29, 2024 · 10 comments · Fixed by #4845

Comments

@matteoscaramuzza
Copy link

Vue - Official extension or vue-tsc version

2.1.2

VSCode version

I use WebStorm

Vue version

3.4.38

TypeScript version

5.5.4

System Info

System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M1
    Memory: 80.02 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.1 - /usr/local/bin/node
    npm: 10.7.0 - /usr/local/bin/npm
    pnpm: 7.13.5 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 128.0.6613.85
    Safari: 17.6

Steps to reproduce

Launch command:
vue-tsc --noEmit --skipLibCheck -p tsconfig.json --composite false

What is expected?

It's expected the build is correctly completed

What is actually happening?

Every reference of custom components in other custom component templates are marked as errors this way:

src/components/partials/ZBaseDatePicker.vue:55:10 - error TS2339: Property 'ZPlainButton' does not exist on type 'Required<{} & __VLS_WithComponent<"ZPlainButton", { "i18n-t": new () => { $props: VNodeProps & TranslationProps; }; "i18n-d": new () => { $props: VNodeProps & DatetimeFormatProps & BaseFormatProps; }; ... 8 more ...; Teleport: { ...; }; } & this, "ZPlainButton", "zPlainButton", "z-plain-button"> & __VLS_WithComponen...'.

55         <z-plain-button

Link to minimal reproduction

No response

Any additional comments?

No response

@basil
Copy link

basil commented Aug 29, 2024

Ditto. Upgrading from vue-tsc and @vue/language-core from 2.0.29 to 2.1.0 (and nothing else) results in 283 new TypeScript errors for me. I read the release notes and nothing appears to have changed. What went wrong?

To reproduce, see neanes/neanes#933. Check out that pull request and run npm install && npm run build. The default branch builds correctly.

@davidmatter
Copy link
Collaborator

davidmatter commented Aug 29, 2024

@basil https://github.com/facing-dev/vue-facing-decorator seems to be the problem here. @matteoscaramuzza are you using some kind of class component decorator library too?

@matteoscaramuzza
Copy link
Author

@basil https://github.com/facing-dev/vue-facing-decorator seems to be the problem here. @matteoscaramuzza are you using some kind of class component decorator library too?

Yes, exactly.

@KazariEX KazariEX changed the title Upgrading vue-tsc from v2.0.29 to v2.1.2: Property 'ZIcon' does not exist on type 'Required<{} & __VLS_WithComponent<"ZIcon", { "i18n-t": new () => { $props: VNodeProps & TranslationProps; }; "i18n-d": new () => { $props: VNodeProps & DatetimeFormatProps & BaseFormatProps; }; ... 8 more ...; Teleport: { ...; }; } & this, "ZIcon", "zIcon", "z-icon">>' Missing components type with vue-facing-decorator Aug 30, 2024
@juanparati
Copy link

I think this issue is related with #4747

BTW: I can reproduce this issue only with 2.1.2 but not with 2.1.0.

@basil
Copy link

basil commented Sep 1, 2024

Hi @davidmatter, I saw that the related PR #4763 was released in 2.1.4. As you can see from the CI build for neanes/neanes#936, this does not resolve the issue and I still get 283 new TypeScript errors with 2.1.4.

@KazariEX
Copy link
Collaborator

KazariEX commented Sep 2, 2024

When using 2.0.X, Can the type of component injected through the decorator be inferred correctly in the template?

@alecgibson
Copy link

We're running into this too. I've done some work on vue-facing-decorator before, so I'm happy to help, but I'm afraid I have absolutely no idea about vue-tsc internals or the nature of the break.

If anyone can enlighten me about what exactly needs to change in vue-facing-decorator (if it is a bug that that, not with vue-tsc), I'm more than happy to put together a Pull Request.

@basil
Copy link

basil commented Sep 6, 2024

Is there a plan to either fix this regression or revert the offending change?

@KazariEX
Copy link
Collaborator

KazariEX commented Sep 6, 2024

When using 2.0.X, Can the type of component injected through the decorator be inferred correctly in the template?

I think I need to know the answer to this question first.

@basil
Copy link

basil commented Sep 6, 2024

I do not know the answer to this question and do not even understand the question. I am just a user who is experiencing a regression. If it helps, the issue can be reproduced reliably in neanes/neanes (e.g. neanes/neanes#933 and neanes/neanes#951).

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

Successfully merging a pull request may close this issue.

6 participants