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

Tag/attribute paths resolved based on package name instead of dependency name #3101

Closed
4 tasks done
glen-84 opened this issue Aug 9, 2021 · 0 comments
Closed
4 tasks done
Assignees
Milestone

Comments

@glen-84
Copy link

glen-84 commented Aug 9, 2021

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Win
  • Vetur version: 0.34.1
  • VS Code version: 1.59.0

Problem

I created a temporary fork of Vuetify 3 (alpha), and installed it like this:

"vuetify": "npm:@company/vuetify-fork@^3.0.0-alpha.10-2"

Vetur tries to load the tags and attributes JSON using the package name instead of the dependency/installation directory name:

const tagsPath = require.resolve(path.join(depPkgJson.name, depPkgJson.vetur.tags), { paths: [packageRoot] });
const attrsPath = require.resolve(path.join(depPkgJson.name, depPkgJson.vetur.attributes), {

It tries to load @company\vuetify-fork\dist\json\tags.json instead of vuetify\dist\json\tags.json.

[Error - 21:07:54] Error: Cannot find module '@company\vuetify-fork\dist\json\tags.json'
Require stack:
- c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js
- c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vueServerMain.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:934:15)
    at Function.resolve (internal/modules/cjs/helpers.js:94:19)
    at getDependencyTagProvider (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:735:3531)
    at getTagProviderSettings (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:735:6541)
    at new HTMLMode (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:736:1524)
    at new VueHTMLMode (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:746:3916)
    at cP.init (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:874:1439)
    at createProjectService (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:874:3677)
    at hP.getProjectService (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:875:10795)
    at async hP.onCodeAction (c:\Users\Glen\.vscode\extensions\octref.vetur-0.34.1\server\dist\vls.js:875:16578)

Reproducible Case

n/a

@yoyo930021 yoyo930021 self-assigned this Oct 4, 2021
@yoyo930021 yoyo930021 added this to the v0.35.0 milestone Oct 4, 2021
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

2 participants