question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • 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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:28
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
octrefcommented, Aug 14, 2020

NVM, should be fixed in #2161.

2reactions
triforcelycommented, Jul 29, 2020

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Go to definition not working on my project (vue & sass file ...
It's working on vue file for autocompletion to import some components for example (with ctrl+space) But impossible to go to definition next with ......
Read more >
How to use vue-router? - CodinGame
Step 1: Make three components inside your components directory. Inside that directory, create three components files. These files are as showing in snippets....
Read more >
Vue.js and TypeScript Problems Collection - Webdevelop Pro
Vue -router functions, beforeRouteEnter, watch and other do not work with Component class. I notice that my code still does not compile because...
Read more >
Vue JS 2 Tutorial #32 - HTTP Requests - YouTube
COURSE LINKS:+ Repo - https://github.com/iamshaunjp/ vuejs -playlist+ Atom editor - https://atom.io/a+ Download GIT - https://git-scm.com/+ ...
Read more >
Vue.js 2 & Vue-Resource- Real-World Vue Application With ...
To access this external API we're going to use the vue-resource packages which provides a service for making web requests and handle responses....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found