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.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
acaocommented, Aug 2, 2022

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

2reactions
acaocommented, Aug 1, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: splice is not a function in JavaScript | bobbyhadz
The "splice is not a function" error occurs when the splice() method is called on a value that is not an array. To...
Read more >
splice method returns an error: is not a function - Stack Overflow
I think the splice function returns an error because games[i] is an object, not an array. If you want to use splice on...
Read more >
Array.prototype.splice() - JavaScript - MDN Web Docs
If you do not specify any elements, splice() will only remove elements from the array. Return value. An array containing the deleted elements....
Read more >
JavaScript Array splice() Method - GeeksforGeeks
JavaScript Array splice() Method · index: It is a required parameter. · remove_count: The number of elements to be removed from the starting...
Read more >
Array methods - The Modern JavaScript Tutorial
The arr.splice method is a swiss army knife for arrays. ... own sorting order, we need to supply a function as the argument...
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