Vetur: [BUG] emmet, autocomplete, props suggestion doesn't work in some .vue files

Created on 24 Jun 2018  路  6Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Win 10
  • Vetur version: 0.12.5
  • VS Code version: 1.24.1

Problem

In some .vue files emmet, autocomplete, props suggestion stops working (.vue files with not much code in them aren't affected)

The number of lines doesn't seem to be the reason it stops working (perhaps tag formatting is what's causing it? Doing f1 => format document isn't fixing the issue).

In the problematic files, if you type div or v-layout or any other tag manually it won't suggest to autocomplete it and after you hit enter, it moves the cursor to the next line without creating a tag.

I've reinstalled it several times (including the manual .vsix method) but it didn't help

UPDATE

The problem is caused by something in <script> section.

When I remove everything inside return { }, it starts working again

export default {
  name: "main",
  data() {
    return {
      ...
    }
  }
}

VUE Language Server - output

Vetur initialized
[Error - 5:26:31 PM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
[Error - 5:26:32 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot set property 'typeParameters' of undefined
  Code: -32603 
[Error - 5:26:34 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
[Error - 5:26:40 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
typescript

Most helpful comment

This seems to be solved in TS 3.3, which you can get by:

See #682 for details.

image

This issue will be completely gone after #1163.

All 6 comments

@AlexSHoffman Hi. i have the similar problems, but mine is that it doesn't work in some project. I have no idea how this happened. Can you tell me how to see the vue language server outputs.

@sunyuu to see the vue language server output you just need to:

  • Open the VScode terminal. Ctrl + ~
  • Go to Output tab
  • Choose the vue language server in the drop down menu

I get the same error. Code to reproduce: gist

I commented the code to show the function causing the problem. When the watcher for value is commented out, everything works fine and emmet works. When it is uncommented, it causes the error and emmet/autocomplete doesn't work. I also noticed commenting out the line 21 (this.rValue = v) causes it not to error. Changing the name of the watcher rValue also makes the error go away.

Errors (I found two different ones):

[Error - 7:05:46 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
[Error - 7:12:26 PM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot set property 'typeParameters' of undefined
  Code: -32603 

Changing my watchers to objects with a handler prop does seem to fix the problem. gist

I got the same error.
Vetur - 0.16.2
veturhovermessagestrace
veturhoverfail
@kindlyfire recommendations works

This seems to be solved in TS 3.3, which you can get by:

See #682 for details.

image

This issue will be completely gone after #1163.

Was this page helpful?
0 / 5 - 0 ratings