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

vls configuration currently does not recognize setup+ts #82

Closed
jerrywu001 opened this issue Oct 25, 2021 · 5 comments
Closed

vls configuration currently does not recognize setup+ts #82

jerrywu001 opened this issue Oct 25, 2021 · 5 comments
Labels
upstream Bug in a dependency

Comments

@jerrywu001
Copy link

First of all, this is a very powerful plug-in, thanks to the author!

But I have a problem, it would be perfect if anyone can improve it.


Scenes:(a simple demo with setup + ts)

My needs:

watch in the devlopment environment,So I can't use vueTsc directly(Because it only applies to the build environment)

<template>
  <p v-cloak>{{ name }}</p>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
const name = ref('test');
</script>

The following error will appear:

  • ERROR(VLS) Module '"xxx.vue"' has no default export

  • ERROR(VLS) Property 'name' does not exist on type 'unknown'.

  • ERROR(VLS) 'name' is declared but its value is never read.

vls configuration currently does not recognize setup+ts

but typescript: true can only applies to xxx.tsx in the development environment,it does not meet my needs


Need your help, Thanks!

@rxliuli
Copy link

rxliuli commented Oct 25, 2021

Is there any progress?

@zerogu
Copy link

zerogu commented Nov 7, 2021

I ran into the same problem

@fi3ework
Copy link
Owner

fi3ework commented Jan 3, 2022

Sorry for the late response. This is vls(vetur) related feature request. According to vuejs/vetur#2296, I think it's not supported by vls now. And TypeScrpit do not support .vue file unless using a customized lang server like vls or vue-tsc.
I think we have to wait for vue-tsc support watch mode. Maybe we can run vue-tsc --noEmit fully whenever any file changed as a simple workaround for now.

@fi3ework fi3ework added the upstream Bug in a dependency label Jan 3, 2022
@MoishyS
Copy link

MoishyS commented Mar 6, 2022

Maybe we can run vue-tsc --noEmit fully whenever any file changed as a simple workaround for now.

@fi3ework I am using vite build --watch and it looks like it does add run vue-tsc --noEmit fully, my issue is that it stops the watch if it has any ts errors.

@fi3ework
Copy link
Owner

vue-tsc in watch mode is supported since 0.4.4. Vue3 can drop VLS now. Have a try!

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

No branches or pull requests

5 participants