We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Actually I'm not sure if this is more Vue 3 or Volar issue.
While importing "PropType" I'm getting warnings in IDE:
'PropType' only refers to a type, but is being used as a value here. ts(2693)
Code for reproduction:
<script setup lang="ts"> import { defineProps, PropType } from 'vue' defineProps({ demo: { type: Object as PropType<{ demo: string }>, required: true, }, }) </script>
Thing is, it looks fine without setup syntax.
<script lang="ts"> import { defineComponent, PropType } from 'vue' export default defineComponent({ props: { demo: { type: Object as PropType<{ demo: string }>, required: true, }, } }) </script>
Same thing happens for me while importing any custom types/interfaces.
import { SomeType } from '@/types/sometypes'
But I found out that warning also disappears after using "import type"
import type { SomeType } from '@/types/sometypes'
Cool, so accordingly we can also do this:
import { defineComponent } from 'vue' import type { PropType } from 'vue'
But this shouldn't be necessary. I also did not found this in any vue docs or RFC. So why this TS warning appears with script setup?
Have a nice day :)
The text was updated successfully, but these errors were encountered:
Hi @chojnicki, this is vue limitation, see: vuejs/core#3183
So I create this error to avoid user runtime error.
Sorry, something went wrong.
Instant reply as always, are you resting at all? 😆
Thanks for linking issue, I will stick with import type then.
I want to finish this project as soon, and then I can rest. 😅
No branches or pull requests
Actually I'm not sure if this is more Vue 3 or Volar issue.
While importing "PropType" I'm getting warnings in IDE:
'PropType' only refers to a type, but is being used as a value here. ts(2693)
Code for reproduction:
Thing is, it looks fine without setup syntax.
Same thing happens for me while importing any custom types/interfaces.
import { SomeType } from '@/types/sometypes'
But I found out that warning also disappears after using "import type"
import type { SomeType } from '@/types/sometypes'
Cool, so accordingly we can also do this:
But this shouldn't be necessary. I also did not found this in any vue docs or RFC. So why this TS warning appears with script setup?
Have a nice day :)
The text was updated successfully, but these errors were encountered: