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

Uncaught TypeError, Cannot read property '0' of undefined #561

Closed
bigblind opened this issue Aug 8, 2017 · 4 comments
Closed

Uncaught TypeError, Cannot read property '0' of undefined #561

bigblind opened this issue Aug 8, 2017 · 4 comments
Projects

Comments

@bigblind
Copy link

bigblind commented Aug 8, 2017

Here's the complete stack trace:

Uncaught TypeError: Cannot read property '0' of undefined
    at getDiagnostics (getDiagnostics.js?6960:46)
    at eval (lint.js?eb0c:43)
    at startLinting (lint.js?af2c:147)
    at Object.eval [as lint] (lint.js?af2c:241)
    at new CodeMirror$1 (codemirror.js?f14e:7645)
    at CodeMirror$1 (codemirror.js?f14e:7590)
    at QueryEditor.componentDidMount (QueryEditor.js?39d7:115)
    at eval (ReactCompositeComponent.js?063f:264)
    at measureLifeCyclePerf (ReactCompositeComponent.js?063f:75)
    at eval (ReactCompositeComponent.js?063f:263)

My code is basically the same as the example in this project's README, providing only a fetcher.

@wincent
Copy link
Contributor

wincent commented Aug 22, 2017

My code is basically the same

Can you show a paste and repro instructions (ie. when does the error appear and what actions did you take before/after)?

@aeiz
Copy link

aeiz commented Feb 26, 2018

I'm having this issue when I use graphiql 0.11.11 with the latest graphql (0.13.1) installed. The moment I uninstall graphql, the graphiql component works as expected.

It works correctly if I install graphql@0.10.1 which is the specific version in graphiql 0.11.11's package.json. Not sure exactly what version of graphql breaks graphiql.

@JustinPlute
Copy link

^ to add onto what @aeiz wrote, I had this same exact error with the most recent graphiql (v0.11.11) and graphql (v0.13.2) packages installed. graphiql and its codemirror-graphql dependency only support graphql (v0.12.2 or under) as defined under peerDependencies in the package.json files. The solution was to downgrade graphql to v0.12.3. This will be an issue if anyone does npm i graphql blindly without specifying a version. In short, graphql v.0.13+ is not supported for graphiql v0.11.11.

@acao acao added this to Needs triage in Bug Triage Sep 22, 2019
@thomasheyenbrock
Copy link
Collaborator

Hey @bigblind 👋 can this bug still be reproduced with the latest GraphiQL version (currently 1.8.10)?

@acao acao closed this as completed Jun 6, 2022
Bug Triage automation moved this from Needs triage to Closed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Bug Triage
  
Closed
Development

No branches or pull requests

6 participants