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

"Go to definition" for methods/computeds does not work in the template - Unable to open '[somefile].vue': resource is not available. #1484

Closed
3 tasks done
sethidden opened this issue Oct 31, 2019 · 5 comments

Comments

@sethidden
Copy link
Contributor

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

Info

  • Platform: Windows 10
  • Vetur version: 0.22.6
  • VS Code version: 1.39.2

Problem

Running "Go to definition" on a method/computed name inside the template (with vetur.experimental.templateInterpolationService enabled) throws an error:
Unable to open 'HelloWorld.vue': resource is not available.

I tested this in Veturpack and the default (babel, eslint) Vue CLI 4 project.

More verbose message from Log (Window) in Output panel:

[2019-10-31 22:17:30.846] [renderer1] [error] resource is not available: Error: resource is not available
    at v.createReferencedObject (file:///C:/Users/atagisow/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:4888:687)
    at v.createReferencedObject (file:///C:/Users/atagisow/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:4888:652)
    at process._tickCallback (internal/process/next_tick.js:68:7)

vetur

When the above gif was made:

  • Vetur was the only enabled extension
  • The contents of settings.json was only "vetur.experimental.templateInterpolationService": true

Reproducible Case

the gif I uploaded is made on the Vue CLI 4 template, here I'll show how to reproduce it in Veturpack

  1. Clone Veturpack
  2. In VSCode go to veturpack\client\components\Counter.vue
  3. Right click count on line 8 and press "Go to definition"

You'll get the Unable to open 'Counter.vue': resource is not available. error

I'm not sure if what I'm describing is even a feature of Vetur? I'm going by what I've read in https://vuejs.github.io/vetur/interpolation.html#generic-language-features -> :

Currently diagnostics, hover, jump to definition and find references are implemented in this way:

So I'm assuming I should be able to do what I'm trying to do.

This issue is different from #707 because it's related to methods/computeds whereas 707 is related to Go Tos in imports

@rs3d
Copy link

rs3d commented Jul 22, 2020

Same error occurs on my system with

  • Vetur 25.0
  • VS Code Insiders 1.48.0-insider
  • OS: Windows_NT x64 10.0.18362
[2020-07-22 14:02:08.115] [renderer1] [error] Unable to resolve resource c:/repos/app/src/views/types.ts: Error: Unable to resolve resource c:/repos/app/src/views/types.ts
    at S.doCreateReferencedObject (file:///C:/Users/User/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6123:107)
    at S.doCreateReferencedObject (file:///C:/Users/User/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6123:70)
    at async b.createModelReference (file:///C:/Users/User/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6124:728)

@triforcely
Copy link
Contributor

I am experiencing the same problem with a similar error message and the file at given path definitely exist.

  • Vetur 0.25.0
  • VS Code 1.47.3
  • Win 10

cereschen added a commit to cereschen/vetur that referenced this issue Aug 14, 2020
cereschen added a commit to cereschen/vetur that referenced this issue Aug 14, 2020
@octref octref added the windows label Aug 14, 2020
@octref
Copy link
Member

octref commented Aug 14, 2020

If you are able to repro, do you mind doing this:

  • Turn on "vetur.trace.server": "verbose"
  • Go to Output -> Vue Language Server
  • Clear all output
  • Do a F12
  • Use Ctrl+F to find last textDocument/definition log
  • Paste it here
  • Do a successful F12 (such as in JS, jump to definition of a variable)
  • Use Ctrl+F to find last textDocument/definition log
  • Paste it here

image

From what I can see in @rs3d's log, it seems to be that the URI is not handled correctly on Windows pathing.

@octref octref closed this as completed in 114e6ca Aug 14, 2020
octref added a commit that referenced this issue Aug 14, 2020
@octref
Copy link
Member

octref commented Aug 14, 2020

NVM, should be fixed in #2161.

@triforcely
Copy link
Contributor

I just finished your repro steps 😅. Glad to hear that this one is fixed, looking forward for the next release.

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

4 participants