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

Vetur features stop working when I specify a vetur.config.js #3162

Open
4 tasks done
ericdrobinson opened this issue Sep 24, 2021 · 6 comments
Open
4 tasks done

Vetur features stop working when I specify a vetur.config.js #3162

ericdrobinson opened this issue Sep 24, 2021 · 6 comments

Comments

@ericdrobinson
Copy link

ericdrobinson commented Sep 24, 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: macOS
  • Vetur version: v0.34.1
  • VS Code version: 1.60.2
  • Environment:
  • Relevant Folder Hierarchy:
    - package.json
    - dom_html/
        - panel/
            - tsconfig.json        [extends ../tscofig-base.json]
        - web/
            - tsconfig.json        [extends ../tscofig-base.json]
        - tsconfig-base.json
    
  • vetur.config.js contents:
    module.exports = {
       settings: {
           "vetur.useWorkspaceDependencies": true,
           "vetur.experimental.templateInterpolationService": true,
           "vetur.trace.server": "verbose"
       },
       projects: [
           {
               root: './dom_html/panel',
               package: '../../package.json',
               tsconfig: './tsconfig.json',
           },
           {
               root: './dom_html/web',
               package: '../../package.json',
               tsconfig: './tsconfig.json',
           }
       ]
    }

Problem

If the vetur.config.js file as shown above exists in the project root, Vetur features fail to activate. The Vue Language Server output does contain the following message:

Vetur initialized

But that is all. No Vetur features beyond syntax highlighting appear to work.

If the contents of vetur.config.js are commented out, then the output shows:

Vetur initialized
[INFO ] Find node_modules paths in /app - 2110ms
[INFO ] Loaded bundled typescript@4.3.2.
[INFO ] Loaded bundled prettier.
[INFO ] Loaded bundled @starptech/prettyhtml.
[INFO ] Loaded bundled prettier-eslint.
[INFO ] Loaded bundled prettier-tslint.
[INFO ] Loaded bundled stylus-supremacy.
[INFO ] Loaded bundled @prettier/plugin-pug.

Enabling the Trace: Server setting to verbose in the extension settings shows lots of message traffic with, presumably, the extension host. I can clearly see hover requests show up but responses are always empty arrays.

Reproducible Case

I do not yet have this information available. What I have found is that simply specifying one of the projects listed in the config shown above and leaving the settings out of it will result in this failure state. The moment that I comment out everything (effectively remove the vetur.config.js file altogether), many features begin to work again (although some of the template interpolation warnings appear to skip some of the TypeScript type declarations).

@yoyo930021
Copy link
Member

Where is vue package?
It isn't a regular monorepo.

@ericdrobinson
Copy link
Author

The vue package is installed in the top-level node_modules folder. It is v2.6.11 with a patch applied.

@ericdrobinson
Copy link
Author

I should also note that I found a path bug in the initial config while reviewing this issue. Fixing that path bug (don_htmldom_html) didn't fix the issue at all.

The Vue Language Server output still gets stuck at "Vetur initialized".

@ericdrobinson
Copy link
Author

The only thing I can think at the moment is that perhaps vetur is finding the tsconfig.json files correctly but not following the inheritance to build the "full config"?

@ericdrobinson
Copy link
Author

Oh, I should also mention that removing one of the projects there so that it only sees, say, the one defined at dom_html/panel ends with the same results...

@yoyo930021
Copy link
Member

If you can provide a minimal repro case, we can study quickly.
https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

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