Vetur: Veture 0.19.0 throwing multiple error messages.

Created on 25 Apr 2019  ·  57Comments  ·  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] 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>
need-more-info

Most helpful comment

my workaround was to disable this option:
"vetur.experimental.templateInterpolationService": false

so, it must be related to that feature

All 57 comments

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

@kinesias You can either rollback, stop using Vetur, or create a repro case instead of ranting.

Sorry, I didn’t mean to rant. Ventur is awesome, so much so I’m using it on a daily basis. I just wanted to point out it has nothing to do with OP‘s variables or code. Thanks for your great work! :)

Seems fixed in 0.19.1. Can you confirm?

image

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

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

@kinesias https://stackoverflow.com/help/mcve. https://github.com/octref/veturpack

Also once you found a minimal repro case, use the command "Vetur: Show corresponding virtual file and sourcemap" to get the info, and put them here too, thanks.

@skydiver You don't have Vue typing installed probably. yarn add vue.

I am having this issue as well with 0.19.1.

I am getting all kinds of errors in the problems tab of VS code, including the Argument of type '{}' is not assignable to parameter of type message mentioned above.

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! :)

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
}

my workaround was to disable this option:
"vetur.experimental.templateInterpolationService": false

so, it must be related to that feature

Hi @octref , here is the virtual file you asked for:

(*only edit: hidden local path names for project privacy)

====================
Virtual content of /home/username/***/components/input/AddressInput.vue.template
Hover, semantic diagnostics, jump to definition and find references are run on this file.
====================

import __Component from "./AddressInput.vue";
import { __vlsRenderHelper, __vlsComponentHelper, __vlsIterationHelper, __vlsListenerHelper } from "vue-editor-bridge";
__vlsRenderHelper(__Component, function () {
    "\n    ";
    __vlsComponentHelper("div", { props: {}, on: {}, directives: [] }, ["\n\n    "]);
    "\n           \n\n        \n                \n\n \n         \n\n              \n\n        ";
});


====================
SourceMap
from: /home/username/***/components/input/AddressInput.vue
to  : /home/username/***/components/input/AddressInput.vue.template
[VueFileStart, VueFileEnd, VueFileText] => [TSVirtualFileStart, TSVirtualFileEnd, TSVirtualFileText]
====================

p.s.
In reference to your comment: "You don't have Vue typing installed probably" , this is a project I've been working on for over a month, and Vetur just started acting up today.

Interesting note:

If I start with an empty file, and add

Got same issue this morning with:

  • Mac OS v10.14.4
  • VSCode v1.33.1
  • Vetur v0.19.1

skydiver's solution works for me.

Thanks.

my main app.vue doesn't need it. but adding lang="html" to my components fixes the issue for me as well. Thanks!

After updating from 0.19.0 to 0.19.1, I got the error:
VETUR
error message:

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)

They happened in every .vue files

v0.19.1

image

image

Interesting note:

If I start with an empty file, and add

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

19.1
[Error - 上午10:33:02] Request textDocument/definition failed. Message: Request textDocument/definition failed with message: Cannot read property 'Symbol(Symbol.iterator)' of undefined Code: -32603

image
I also met

Same issues here guys. Had to roll back to 0.18.1 and everything is back to working.

i hava same problem in vetur 0.19.0, and vscode 1.33.1
when i set "vetur.validation.template": false , all good。
image

The PR in #1222 doesn't fix @yinxulai https://github.com/vuejs/vetur/issues/1237#issuecomment-486497996 case

I have the same: <templates> : An object literal cannot have multiple properties with the same name in strict mode.Vetur(1117)

VSCode v1.33.1
Vetur v0.19.1

image

image

image

@vadimjoy That's not related to this issue. -> #1203

in the documentation is the solution:
https://vuejs.github.io/vetur/interpolation.html#generic-language-features

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!

The same problem in vetur 0.19.1

E7417C4F-0B3B-4A94-9B86-34BE5A68EC1D

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.

Same issue with 0.19.1. :(

Same problem

Hey Peeps,
I had the same issue as well.
I think for the moment we can switch to the version 0.18.1 of Vetur.
Do not forget to disable the plugins automatic update on VSCode.
It could be a temporary solution until version 0.19.1 is fixed.

Same on Windows with vscode and Vetur. I downgraded but had to disable auto update for extensions because it just updated again the next restart... Hopefully it's fixed soon and can return to standard settings. I can confirm 0.18.1 works fine but update breaks.

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!

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.

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

@cyrrill, I understand your frustration. I'm not a Vetur contributor, BUT keep in mind this is open source software. And the contributors have provided superb work that makes all of our lives easier, but bugs do happen especially when making significant changes to the foundation of an extension such as this one. Open source projects do not have infinite resources to test every permeation of every project and development environment. This is the price will all pay for fast release cycles and responsive releases and free software. In the end these features will eventually make our lives easier and more productive.

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.

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

image
image

rollback version to 0.18.1 but, when i reload my vscode, this package is updated. 😰

Change vetur settings
Uncheck the following
Validation: Template
Validate vue-html in