Skip to content

[lsp-server] svelte & vue issues with LSP server #2836

@tobiasdiez

Description

@tobiasdiez

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The following error is logged:

10/23/2022, 4:15:03 PM [1] (pid: 1704) graphql-language-service-usage-logs: Could not parse the Vue file at file:///workspace/components/JabrefLogo.vue to extract the graphql tags:
10/23/2022, 4:15:03 PM [1] (pid: 1704) graphql-language-service-usage-logs: Error: [@vue/compiler-sfc] SFC contains no <script> tags.

Expected Behavior

No error is logged, and the vue file is simply ignored.

Steps To Reproduce

Just have one vue file without a script block, then the above error is logged in the vscode console.
Example:

<template>
  <div>
    Hello!
  </div>
</template>

Module pattern

  • graphiql-umd
  • graphiql-esm
  • graphiql-commonjs

Environment

- GraphiQL Version:
- OS:
- Browser:
- Bundler:
- `react` Version:
- `graphql` Version:

Anything else?

The error is thrown here: https://github.com/vuejs/core/blob/b0b74a160c08941fa9a7a5460f36a1f2fccbf423/packages/compiler-sfc/src/compileScript.ts#L195-L198 So I guess it should be sufficient to check if the sfc descriptor has a script or script setup field, before calling the compileScript method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglsp-servergraphql-language-service-server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions