vetur: Veture 0.19.0 throwing multiple error messages.
Info
- Platform: macOs
- Vetur version: 0.19.0
- VS Code version: 1.33.1
Problem
In code edit, error (red squiggle) on word ‘template’
Seeing multiple error messages stating can’t find xxx, as example:
Cannot find name 'drag'.
Cannot find global type 'BigInt'.
Expected 3 arguments, but got 7.
The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
Have also seen message that my .vue file is not a module.
Changing
<template>
<form v-on:submit.prevent class="toolbar grid5 drag-disabled">
<slot></slot>
</form>
</template>
to
<template lang="html">
<form v-on:submit.prevent class="toolbar grid5 drag-disabled">
<slot></slot>
</form>
</template>
seems to solve the problem, at least not reporting any errors.
Here’s my .vue file
<template lang="html">
<form v-on:submit.prevent class="toolbar grid5 drag-disabled">
<slot></slot>
</form>
</template>
<script>
export default {
}
</script>
<style lang="less" scoped>
form.toolbar.grid5 {
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-gap: 0.3em 0.6em;
grid-auto-flow: dense;
align-items: center;
}
form.toolbar {
padding: 5px;
background-color: @soft-black;
border-radius: 4px;
position: absolute;
width: calc(100% - 30px);
bottom: 10px;
}
</style>
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 23
- Comments: 57 (11 by maintainers)
my workaround was to disable this option:
"vetur.experimental.templateInterpolationService": false
so, it must be related to that feature
@kinesias You can either rollback, stop using Vetur, or create a repro case instead of ranting.
I’m getting these errors on every .vue file
Hi all,
Earlier I mentioned that
<template lang="html">
would sort the issue, that is so. However, I only mentioned that as a debugging clue for the maintainers. It was not meant to be a solution, and I personally have not done so in my code.It is not a good idea to go and “pollute” all your code with unnecessary markup just to palliate this bug.
Additionally, it is not necessary to downgrade, or much less to disable auto-update in Code, that can cause other issues.
The best way to deal with this while the maintainers of the extension fix this, as noted by @skydiver, is to simply disable the experimental feature which got added in the latest release, by going into:
File > Preferences > (search for “vetur”), and then disable this checkbox:
@octref @ktsn in the future please do not enable “experimental” features by default. It’s ok to ship it so we can test it, but ship it in an optional and disabled manner so that untested code doesn’t wreak havoc as seen here.
Thanks!
@octref No one is purposely misleading anyone. However, you do seem to have an accusative tone which is unproductive.
Instead of releasing broken software and expecting people to dig through the docs of an obscure extension in their IDE (who reads that?!), better test what you code, and if you decide to release “experimental” features, don’t turn them on by default and expect everyone to figure out why it’s broken.
I’m sorry, I still get the same errors with 0.19.1. here’s a screenshot. the error messages eg "cannot find name ‘emplate’ seems weird…
Please stop misleading people by saying adding
lang="html"
fixes the problem.If you have read the docs you would find there’s a setting to turn this off:
You can also use
vetur.validation.template
false to disable all template validation.A new Vue file with only the bare minimal tag:
Also getting these errors in older existing Vue files:
I understand you need more info to determine a fix, however, it seems that quite a few people are having issues so I would consider this a confirmed bug.
Thanks for you work on Vetur, it’s an amazing extension! 😃
Interesting note:
If I start with an empty file, and add <script> & <style> tags, all good, no errors.
As soon as I add a
<template>
tag to the file, it throws the error.Interestingly, a template tag such as this:
or say with lang=“pug”, throws no exception. It seems to be only a bare
<template>
tag which is problematic.Can confirm! 0.19 breaks EVERYTHING in VS code! this is a main issue! I have VS Code Version 1.33.1.
Some of the error messages I get are:
The parser seems to be kaput…
I found the following cases generate number of weird errors in template (at Vetur 0.19.1):
:value="`foo: ${foo}`"
) -> #1230, #1244:class="{ 'literal-class': true }"
)I’m fixing these cases now. If there are other case which causes this kind of issue, please comment it with reproducible
.vue
file. Thanks for your cooperation!Note to others, unchecking
vetur.experimental.templateInterpolationService
did not have an immediate effect. A restart of vscode after turning it off fixes all issues described above.rolled back to 0.18.1
remove 0.19.1
download 0.18.1 https://marketplace.visualstudio.com/_apis/public/gallery/publishers/octref/vsextensions/vetur/0.18.1/vspackage
install
I just rolled back to 0.18.1 and everything works perfectly again for me. 0.19.1 doesn’t seem to be stable at the moment…
Same issue here
@cyrrill Stop taking conversations out of their context, please? That was in response to @kinesias’s comment, not to the OP.
I’m not aware of that implication. Maybe it’s because I’m not a native speaker. I only meant “please don’t lead people to wrong solution”, in the spirit of not increasing invalid bugs reports. I was already getting 20+ issues and I didn’t want more invalid ones.
I didn’t imply dishonesty from you. If that’s how you interpreted it, sorry. I could have used some words like “That’s not the right solution”, but I had many people coming into these issues and I had to stop them from following the wrong advice.
Adding lang=“html” definitely clears errors as reported. Gotta be a hint there.
@octref The Vue community appreciates all the hard work you have done maintaining this plugin. It’s the one we all use for Vue. No one is impervious to bugs or stress. The plugin speaks for itself of the level of professionalism you have and hope no one else doubts your integrity.
v0.19.1
@octref, the context is quite clear for anyone reading the thread.
No one gets 40 👎 on their comment without merit, so please don’t pretend like you’re so innocent and oblivious to your crassness.
You can write the most amazing software, but if you treat people dismissively and rudely, nothing has been gained.
The basic point here is: treat people with respect, and your life as a maintainer (and in general) will be much easier.
.
rollback version to 0.18.1 but, when i reload my vscode, this package is updated. 😰
@outofmemoryagain , I totally get that, my response comes to the developer’s attitude, not the product. Besides, octref is not a random starving opensource developer, he’s at Microsoft, where professionalism would be expected.
If you read:
https://github.com/vuejs/vetur/issues/1237#issuecomment-486460904 https://github.com/vuejs/vetur/issues/1237#issuecomment-486726769
You’ll notice a dismissive and harsh tone, which is not productive at all in collaborative projects.
Anyways, this is veering way off-topic. It’s clear what the bug is, and a solution is probably soon to come.
Got the same issue with v0.19.1. File … is not a module. If I add
<template lang="html">
then all is ok, but this is not a good fix, because I need to modify all my files and in all my projects. Hope will be fixed soon.in the documentation is the solution: https://vuejs.github.io/vetur/interpolation.html#generic-language-features