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

The new version in vscode will report an error, for example:Property 'XXXX' does not exist on type 'Vue'.Vetur(2339) #1242

Closed
vibin-lin opened this issue Apr 25, 2019 · 34 comments

Comments

@vibin-lin
Copy link

After upgrading the new version of vetur in vscode today, every page will report an error, for example:Property 'XXXX' does not exist on type 'Vue'.Vetur(2339)
But I don't use typescript

image

@StriveTeam
Copy link

vetur: version 0.18.1 is ok

@Louiscd
Copy link

Louiscd commented Apr 25, 2019

ME TOO

@OldDream
Copy link

I roll back to 0.18.1

@vadimjoy
Copy link

vadimjoy commented Apr 25, 2019 via email

@cavencj
Copy link

cavencj commented Apr 25, 2019

image

all Vue file have this problem

@AnthonyChamberlin
Copy link

AnthonyChamberlin commented Apr 25, 2019

yep rollback to 0.18.1 works 👍 thanks!

Incase you're unaware how to rollback version in vscode:
Screenshot 2019-04-25 at 09 36 02

@topul
Copy link

topul commented Apr 25, 2019

I roll back to 0.18.1 too

@gunydev
Copy link

gunydev commented Apr 25, 2019

rollback to 0.18.1 it work!

@bagaskarala
Copy link

the new vetur formatting (indentation) also doesnt work well :(

otw rollback to 0.18.1

@kinesias
Copy link

temporary solution: "vetur.experimental.templateInterpolationService": false

@jzatt
Copy link

jzatt commented Apr 25, 2019

Spend some time trying to figure out why all my .vue files where reporting (strange) errors all of the sudden. Also tried the temporary solution above... Rollback to 0.18.1 was the only thing that worked.

@alainux
Copy link

alainux commented Apr 25, 2019

You can also disable template formatting for HTML

@amdp
Copy link

amdp commented Apr 25, 2019

"vetur.experimental.templateInterpolationService": false works!
Just go to settings and in the search box copy "vetur.experimental.templateInterpolationService": false and you will find the switch!

thanks kinesias!

@stevyrino
Copy link

Having same problem on all vue components ... vetur(2304) ... property value does not exist.

@freespiriter
Copy link

Property '$route' does not exist on type 'CombinedVueInstance<Record<never, any> & Vue, object, object, object, Record<never, any>>'.Vetur(2339)
I meet the same problem.

@0xe69e97
Copy link

thinks 0.18.1 is ok!!

@GzhiYi
Copy link

GzhiYi commented Apr 26, 2019

回到0.18.1后再把扩展自动更新关了,等扩展后续更新吧。

@octref
Copy link
Member

octref commented Apr 26, 2019

Please give a repro case. Like paste your actual code here. Not a picture.

@aphofstede
Copy link

@octref

<template>
    <div :foo="bar"></div> // <- "Property 'bar' does not exist on type 'CombinedVueInstance<Vue, object, object, object, Record<never, any>>'.Vetur(2339)"
</template>

<script>
export default {
    props: {
        bar: Array,
    },
}
</script>

@octref
Copy link
Member

octref commented Apr 26, 2019

@aphofstede Reported upstream issue vuejs/vue#9935

In the future please create new issues instead of appending to a different issue, thanks.

@aphofstede
Copy link

Ah, I thought you specifically asked for a repro case here. Thanks for investigating! 👍

@RyannGalea
Copy link

Does anyone know why I'm having this issue with nuxt using typescript. Having issues calling methods? Works in dev but cannot build

nuxthelp

@jayporta
Copy link

jayporta commented May 14, 2019

@RyannGalea Yes. When using Vue class components, methods go inside the class, not in the component object.

Example:

export default class YourClass extends Vue {

  toggleMenu () {
    ....
  }

  closeMenu () {
    ....
  }
}

@jayporta
Copy link

This is still happening even on 0.18.1. I created an interface for an object but Vetur is still displaying an error

interface tableRow {
  name: string,
  message: string
}

interface TableData {
  columnTitles: Array<string>,
  rows: Array<TableRow>
}
export default class Bookings extends Vue {
  tableData!: Array<TableData>

  mounted () {
    // error: Property 'rows' does not exist on type 'TableData[]'.Vetur(2339)
    this.tableData.rows.push({ 
       name: 'Jay',
       message: 'Using TypeScript in Vue is really frustrating' 
    })
  }
}

@Drumstix42
Copy link

Had to disable vetur.experimental.templateInterpolationService to prevent this bug from happening where something was defined under props but not under data, etc.

@rchl
Copy link
Collaborator

rchl commented Sep 9, 2019

@octref This seems to still be a problem in vetur 0.22.2.

The upstream issue is still open and the PR submitted upstream was rejected with a statement that it works in typescript >=3.5 anyway.

So, is vetur using old, bundled typescript (it seems so here)?

In SublimeText, where I'm using latest vue-language-server 0.0.60, it actually works fine, but not in vetur. In SublimeText I'm getting this info in the console:

lsp-vue: Loaded bundled typescript@3.6.2.

so the one I've installed in my project. In Vetur, I see Loaded bundled typescript@3.3.4000..

So easy fix? Update bundled typescript? Or is there a way to use one from the project?

@octref
Copy link
Member

octref commented Sep 12, 2019

@rchl You can upgrade to 0.22.3: https://github.com/vuejs/vetur/releases/tag/v0.22.3

@lvaroqui
Copy link

Still have the issue with nuxt components !

@rchl
Copy link
Collaborator

rchl commented Sep 16, 2019

@lvaroqui feel free to post your component somewhere for someone to look. Sometimes you need to explicitly annotate things like head or computed for this to work.

@jsuria
Copy link

jsuria commented Sep 7, 2020

Encountered this just now. Turns out the Vetur component needed to be reloaded and the error went away, but the usual notification icon on the vscode sidebar didn't display (had to check the Extensions page on a hunch). Might be a vscode bug?

@atilkan
Copy link

atilkan commented Oct 20, 2020

It does it again. Current version 0.28

@yoyo930021
Copy link
Member

It does it again. Current version 0.28

Please turn off vetur.validate.template: false.
This problem is in vue 2 libs. We can't fixed it.

@falconvk
Copy link

It does it again. Current version 0.28

Please turn off vetur.validate.template: false.
This problem is in vue 2 libs. We can't fixed it.

What about this still happening inside the script?
Referencing any part of data or methods with this.property results in this error.
Do we just disable the script validation completely? 😕

@octref
Copy link
Member

octref commented Oct 29, 2020

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

No branches or pull requests