graphiql: "`this.splice()` is not a function" error on `vscode-graphql` startup

My VSCode plugin is failing to start, logging the following error:

image

8/1/2022, 11:58:03 AM [1] (pid: 32510) graphql-language-service-usage-logs: WARNING: graphql-config error, only highlighting is enabled:
this.splice is not a function

and

[Error - 12:05:13 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: this.splice is not a function
  Code: -32603 

This is my current .graphqlrc.yml

schema: "http://localhost:4000/_introspect"

maybeValue: T
config:
  enumsAsTypes: true
  useTypeImports: true
  nonOptionalTypename: true
  scalars:
    Time: number
    DateTime: Date
    Json: Record<string, unknown>
generates:
  app/types/apollo.gql.d.ts:
    plugins:
      - typescript-apollo-client-helpers
  app/types/schema.gql.d.ts:
    documents: "**/*.gql"
    plugins:
      - typescript
  app/:
    documents: "**/*.gql"
    preset: near-operation-file
    presetConfig:
      baseTypesPath: "types/schema.gql.d.ts"
      extension: .gql.d.ts
    plugins:
      - typescript-operations
      - typescript-react-apollo

The same setup was working up to last Friday, and is still working on my colleagues machines.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 19 (15 by maintainers)

Most upvoted comments

tested it from the marketplace again with introspection, gql files, everything looks good now!

ok! thank you, this is all very helpful to know, I will see if I can reproduce the issue with this new information! i’m sorry the extension broke for them. I might even just be able to delete the version, reproduce this, and re-try

update:

reproduced it finally! ok I hope to have a fix by tomorrow but maybe tonight if I can get it done before 2am here haha. very sorry for this bug!

Fantastic to hear the confirmation! I have more plans to improve the introspection schema user experience. For example, it seems there is still the issue with the cached SDL file not updating. Many more features coming soon but we will use pre-releases to avoid this happening again.

I have an elixir side project using Mobilizon, it such a neat runtime! Happy graphql-ing!

Updated it and it now works just fine. Thanks @acao \o

oooh this is some npm ^ resolution madness haha!

so, even though we are pinned to the same graphql-config@4.3.0 version, the @graphql-tools/url-loader package resolves to a much better new version that doesn’t use cross-undici-fetch at all!

sorry for the deep dive @VictorGaiva , just going into these details because I tagged some colleauges who maintain these libraries. I will let you know when the fix is ready for you and your colleauges