vetur: Veture 0.19.0 throwing multiple error messages.

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

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)

Most upvoted comments

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

image

Argument of type '{}' is not assignable to parameter of type 'new (...args: any[]) => any'.
  Type '{}' provides no match for the signature 'new (...args: any[]): any'.

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:

image

@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… Bildschirmfoto 2019-04-25 um 01 50 22

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:

image

You can also use vetur.validation.template false to disable all template validation.

A new Vue file with only the bare minimal tag:

image

Argument of type '{}' is not assignable to parameter of type 'new (...args: any[]) => any'.
  Type '{}' provides no match for the signature 'new (...args: any[]): any'.Vetur(2345)

image

Also getting these errors in older existing Vue files:

An object literal cannot have multiple properties with the same name in strict mode.Vetur(1117)
An object literal cannot have multiple properties with the same name in strict mode.Vetur(1117)
An object literal cannot have multiple properties with the same name in strict mode.Vetur(1117)
Expected 2 arguments, but got 5.Vetur(2554)
Expected 3 arguments, but got 2.Vetur(2554)
The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.Vetur(2362)

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:

<template lang="html">
</template>

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:

  • Cannot find global type ‘BigInt’.
  • The left-hand side of an arithmetic operation must be of type ‘any’, ‘number’, ‘bigint’ or an enum type.

The parser seems to be kaput…

I found the following cases generate number of weird errors in template (at Vetur 0.19.1):

  1. Using template literal (:value="`foo: ${foo}`") -> #1230, #1244
  2. Using string literal for some object literal property name (: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.

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 image

{
	"resource": "/c:/Users/Ken/Desktop/vue-demo/src/pages/stocks/index.vue",
	"owner": "_generated_diagnostic_collection_name_#1",
	"code": "2345",
	"severity": 8,
	"message": "Argument of type '{}' is not assignable to parameter of type 'new (...args: any[]) => any'.\n  Type '{}' provides no match for the signature 'new (...args: any[]): any'.",
	"source": "Vetur",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 1
}

@cyrrill Stop taking conversations out of their context, please? That was in response to @kinesias’s comment, not to the OP.

image

I don’t see the point in saying people are “misleading”, that’s a strong term which implies dishonesty.

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.

No one is purposely misleading anyone. However, you do seem to have an accusative tone which is unproductive.

I’m accusative because adding lang="html":

  • Requires users to change their code (which they shouldn’t, it’s a Vetur bug)
  • Disables all other Vetur feature for template region

I don’t want to solve new issues that says “hey why emmet doesn’t work in my region”.

Instead of releasing broken software and expecting people to dig through the docs of an obscure extension in their IDE (who reads that?!)

Opening issue asks you to tick this box.

image

if you decide to release “experimental” features, don’t turn them on by default and expect everyone to figure out why it’s broken.

Then no one will find it and use it. You just said “no one would dig through the docs of an obscure extension in their IDE”.

Once this feature matures it’ll be a major differentiator for Vue over React (which relies on TypeScript for language features) or Angular (whose AOT is what many people want for their TS projects, but its language features aren’t working well today). So I’d like to turn it on, iterate and improve. If you don’t like it, there are multiple ways to opt-out.

Besides, octref is not a random starving opensource developer, he’s at Microsoft, where professionalism would be expected.

image

If you aren’t giving a repro and yelling at me “EVERYTHING IS BROKEN”, there’s nothing I can help so I’ll be curt. I got limited time and hundreds of issues in my inbox. You should read https://nolanlawson.com/2017/03/05/what-it-feels-like-to-be-an-open-source-maintainer/ because that’s how I feel.

In short:

  • Yelling helps no one. Open non-duplicate issues with minimal reproducible case and I’ll be able to help.
  • I had to stop people from reading “oh adding lang="html is the solution!” because clueless people might follow that and open even more invalid issues.

@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

image

image

@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.

.

image image

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.