-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
VTI feedback thread #1635
Comments
@octref Thank you for taking the time to do this! It looks like it also goes through Repro:
Throws:
PS: let me know if you want a dedicated issue |
@cexbrayat I can repro it. Opened #1639. For bugs please use new issue. |
How can this be used on a whole Vue project? Or a Nuxt project? |
"any" error with text "Property '...' does not exist on type 'object'.Vetur(2339)" not being outputted. Please check. |
@goldingdamien If you have bugs, please make a repro case and open a new issue. |
@octref Will it be possible to catch type errors for the props of another component? Eg. something like: <template>
<MyComponent date="2019" />
</template>
So to have VTI check the type of the prop of the underlying component which are defined like so: props: {
date: Object as PropType<Date>
} |
|
Is VTI already supposed to work with Vue 3? I've not been able to get any relevant result. Here is my setup (look readme): https://github.com/shameleo/vue-next-test/tree/f1ed6946ec92b6678cb835465db86926bda06775 |
Thanks so much for doing this, @octref. This is going to be huge for us when it's stable. I'm currently seeing the same issue that @ktsn has opened here: #1699 I'll try to open a simplified, reliable repro rep EDIT: created repro case here, though I suspect the breaking point, file-count-wise, may be machine-specific. If anyone on this thread has a few minutes to try the README steps below & let me know if they see similar behavior, that'd be much appreciated git clone https://github.com/jackkoppa/vti-failures-1699.git
cd vti-failures-1699
npm ci
npm run vti
# fails
# Now, change one of the ComplexComponent files from .vue -> .txt
# thus removing it from vti observation, and run vti again
mv src/components/ComplexComponent4.vue src/components/ComplexComponent4.txt
npm run vti
# succeeds
# Finally, if you *still* see a failure message, we can try one more thing:
git checkout -- .
git clean -df
# Branch w/ even fewer vti-checked files
git checkout minimal-file-count-for-additional-testing
npm run vti |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
#1805 will fix. |
After spending very many hours on "my utlimate Vue setup" I've found that JS/TS errors in the template is really the missing ingredient for me. I want to see error 2339 when a developer references an attribute that does not exist! I think VTI may be the key. Thanks for all the hard work on this (and Vetur). Two quick questions:
|
You can turn it on with
I don't think you can use TS in template interpolations without extra setup. |
This is related to my question on #2036. I have code in a template tag like Object is possibly 'null'.Vetur(2531) However, when I run
and do not see this error. How would I specifically get |
What kind of use-cases do you have in mind for VTI? I think it would be very useful along with a lint step in CI/build pipelines, for example. The docs here don't seem to quite contain enough information for me to easily figure out how to run a debugger on VLS when running I have some ideas for minor improvements and contributions. Is creating an issue the best way to propose changes? |
@andrewisaburden I use |
Thanks for making |
Me too. |
At the moment it seems that the |
You can open a new issue on it. ^_^ |
Sure |
Very cool tool. I'm wondering if it would be possible to accept a flag to only show errors on failure. and otherwise just be silent? I'd liked to incorporate this into my npm build (as a pre-commit hook using 'shared-git-hhok') and currently it spams the console. Maybe a flat '--errors-only' or '--log-level DEBUG/INFO/WARN/ERROR ? The latter allowing more room for printing diagnostics if required. Many thanks for building this tool |
@bertvanbrakel I think this will be solved with #2451 |
When I use VTI with css modules I always get same errors:
|
We've enabled it in a medium sized project (currently 300+ .vue files) and I can't live without it! That said - some features i'd like to see:
|
I'm using vue 2 and have a mix of typescript and non-typescript components. I'd love to be able to tell vti to ignore my plain javascript components and just run diagnostics for my typescript components.
|
When using syntax in my template like so:
I'm getting errors that content-type hasn't been supplied in type when it is clearly defined here in the component and is supplied? It works with kebab case e.g. content-type
|
Hey pretty cool package, I have trouble to set it up correctly, if anyone could perhaps provide some guidance. I have installed it globally, now in vscode I have enabled template interpolation. Now I am going into a file without any type errors and copy the relative path. When I am running now: vti diagnostics -l ERROR . src/components/widgets/compopnenWithoutErrors.vue I am getting something like this:
SO it is basically showing me that there are errors, but if I check manually I do not see any error. or like this in a component which does not even get any props Error: Subsequent property declarations must have the same type. Property 'props' must be of type '{ [other: string]: any; 'available-products': any; 'loading-products': any; 'session-state': any; 'default-addons': any[]; }', but here has type '{ [other: string]: any; 'available-products': any; 'loading-products': any; 'default-addons': any; 'recommended-products': any; }'.
> 1 | <template> |
I don't know if vti is still relevant but from my experience its setup is too hard to be worth it.
This are issues that every single user would face but it is not documented how to resolve them. So vetur is useless as its just highlighting every single line in vue files. |
@Popeye4242 I essentially gave up on the issue as well. |
I've ran in to an issue with the following code, where vti doesn't seem to pick up the correct type for Error: Type 'number | null' is not assignable to type 'number | undefined'.
Type 'null' is not assignable to type 'number | undefined'.
4 | <DropZone
5 | :processing="importProgress !== null || isLoading"
> 6 | :processingProgress="importProgress"
| ^^^^^^^^^^^^^^^^^^
7 | :limit="1"
8 | :error.sync="dropzoneError" private get importProgress(): number | null {
const uploadRange = 85;
if (this.uploadProgress === null) {
return null;
}
return (uploadRange / 100) * this.uploadProgress;
} DropZone.vue: @Component({
components: { ProgressBar, WithDragAndDrop, LoadingIndicator },
})
export default class DropZone extends Vue {
// ... other props
@Prop({ default: null, type: Number, required: false })
private readonly processingProgress: number | null; |
VTI (Vetur Terminal Interface) is available since 0.23.0.
Docs: https://vuejs.github.io/vetur/vti.html
Usage:
npm i -g vti # run this in the root of a Vue project vti vti diagnostics
It's not very well tested. I don't have the bandwidth to test it in real world projects.
Formatting can be done, but I'm not sure what config to prefer.
Anyway, this surfaces Vetur's interpolation service's errors onto CLI. When this becomes stable enough, it can help people catch errors currently uncatchable by Vue's compiler or Webpack.
If you have bug with repro cases, open new issues.
The text was updated successfully, but these errors were encountered: