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

Release 0.40.0+ showing lot of errors (components, events, etc) #1795

Closed
cn-2k opened this issue Aug 31, 2022 · 4 comments
Closed

Release 0.40.0+ showing lot of errors (components, events, etc) #1795

cn-2k opened this issue Aug 31, 2022 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@cn-2k
Copy link

cn-2k commented Aug 31, 2022

After update to 0.40.0+ versions my VSCode start to show lot of errors in my custom components, click events and custom events, functions/methods, etc. Im using script setup with typescript. On version 0.39.5- everything works fine, this can be fixed?

image

image

@xiaoxiangmoe
Copy link
Collaborator

Can you provide me a minimal reproducible example?

@cn-2k
Copy link
Author

cn-2k commented Aug 31, 2022

Can you provide me a minimal reproducible example?

For sure!

1 - Clone this repo that I made: https://github.com/caio-2k/volar-error-report
2 - Run npm install and see App.vue

On v0.40.5 I had those issues (the reactive data has been considered as JSX Elements):

image

On v0.39.5 this works fine (just an linting error but works anyways):

image

@xiaoxiangmoe
Copy link
Collaborator

Please use

const datas = reactive({
  roles: [] as Array<string>,
  entities: [] as Array<any>,
});

Because newest volar only allow syntax in tsx.

You can use consistent-type-assertions with assertionStyle: "as".

@xiaoxiangmoe xiaoxiangmoe added duplicate This issue or pull request already exists and removed need info labels Sep 1, 2022
@xiaoxiangmoe
Copy link
Collaborator

duplicate of #1706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants