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.

Playground with facebooks create-react-app fails to compile

See original GitHub issue

This issue pertains to the following package(s):

  • GraphQL Playground - Electron App
  • GraphQL Playground HTML
  • GraphQL Playground
  • GraphQL Playground Express Middleware
  • GraphQL Playground Hapi Middleware
  • GraphQL Playground Koa Middleware
  • GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

OSX

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

“graphql-playground-react”: “^1.7.0”,

What is the expected behavior?

Working local playground react client

What is the actual behavior?

Module not found: Can't resolve 'graphql/validation/rules/ExecutableDefinitions' https://github.com/graphql/graphql-language-service/issues/239

What steps may we take to reproduce the behavior?

Create react app with https://github.com/facebook/create-react-app and follow your own Playground React instructions

Please provide a gif or image of the issue for a quicker response/fix. client____documents_workspace_emundo_crepo-graphql_client__-____package_json__client

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

3reactions
tizmagikcommented, Nov 24, 2019

I just hit this today with a fresh create-react-app --typescript app:

"dependencies": {
    "graphql-playground-react": "^1.7.20",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-redux": "^7.1.3",
    "react-scripts": "3.2.0",
    "typescript": "3.7.2"
  },
import React from "react";
import { Provider } from "react-redux";
import { Playground, store } from "graphql-playground-react";

const App: React.FC = () => (
  <Provider store={store}>
    <Playground endpoint="https://api.graph.cool/simple/v1/swapi" />
  </Provider>
);
1reaction
tizmagikcommented, Nov 25, 2019

If you npm i graphql as a direct dependency (which pulled down graphql@14.5.8 as of this writing) it gets you around the error and the app seems to work. However, the following console error appears when running the app:

Uncaught Error: Cannot use GraphQLSchema "[object Object]" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
    at instanceOf (:3000/static/js/0.chunk.js:84859)
    at isSchema (:3000/static/js/0.chunk.js:91596)
    at assertSchema (:3000/static/js/0.chunk.js:91599)
    at validateSchema (:3000/static/js/0.chunk.js:91914)
    at assertValidSchema (:3000/static/js/0.chunk.js:91937)
    at validate (:3000/static/js/0.chunk.js:100267)
    at validateWithCustomRules (:3000/static/js/0.chunk.js:47626)
    at validateQuery (:3000/static/js/0.chunk.js:46011)
    at getDiagnostics (:3000/static/js/0.chunk.js:45999)
    at :3000/static/js/0.chunk.js:6039
    at startLinting (:3000/static/js/0.chunk.js:9937)
    at :3000/static/js/0.chunk.js:9985
Read more comments on GitHub >

github_iconTop Results From Across the Web

Playground with facebooks create-react-app fails to compile
This issue pertains to the following package(s): GraphQL Playground - Electron App GraphQL Playground HTML GraphQL Playground GraphQL ...
Read more >
React JS npm start shows failed to compile web-vitals
You need to install web vitals. Open your terminal and run the following command: npm i web-vitals --save-dev.
Read more >
Create React App
Whether you're using React or another library, Create React App lets you focus on code, not build tools. To create a project called...
Read more >
Getting Started - React
In this tutorial, we build a tic-tac-toe game in React. ... to building any React apps, and mastering it will give you a...
Read more >
UNPKG - @jam3/react-hooks
The CDN for @jam3/react-hooks. ... @jam3/react-hooks/playground/README.md. Version: ... 22, Builds the app for production to the `build` folder.<br />.
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