-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Using [email protected] with [email protected] fails with the following error:
ERROR in ./node_modules/graphql-language-service-utils/esm/__tests__/validateWithCustomRules-test.js
Module not found: Error: Can't resolve 'fs' in '/src/graphiql/node_modules/graphql-language-service-utils/esm/__tests__'
@ ./node_modules/graphql-language-service-utils/esm/__tests__/validateWithCustomRules-test.js 1:0-34 9:29-41
@ ./node_modules/graphql-language-service-utils/esm sync ^.*\.js$
@ ./node_modules/graphql-language-service-utils/esm/file.js
@ ./node_modules/graphql-language-service-utils/esm/index.js
@ ./node_modules/graphql-language-service-interface/dist/getDefinition.js
@ ./node_modules/graphql-language-service-interface/dist/index.js
@ ./node_modules/codemirror-graphql/hint.js
@ ./node_modules/graphiql/dist/components/QueryEditor.js
@ ./node_modules/graphiql/dist/components/GraphiQL.js
@ ./node_modules/graphiql/dist/index.js
@ ./client/main.jsx
It appears that Webpack is trying to include files based on a regular expression (???) which then matches test code.
WARNING in ./node_modules/graphql-language-service-utils/esm/file.spec.js 53:37-93
Critical dependency: the request of a dependency is an expression
@ ./node_modules/graphql-language-service-utils/esm sync ^.*\.js$
@ ./node_modules/graphql-language-service-utils/esm/file.js
@ ./node_modules/graphql-language-service-utils/esm/index.js
@ ./node_modules/graphql-language-service-interface/dist/getDefinition.js
@ ./node_modules/graphql-language-service-interface/dist/index.js
@ ./node_modules/codemirror-graphql/hint.js
@ ./node_modules/graphiql/dist/components/QueryEditor.js
@ ./node_modules/graphiql/dist/components/GraphiQL.js
@ ./node_modules/graphiql/dist/index.js
@ ./client/main.jsx
WARNING in ./node_modules/graphql-language-service-utils/esm/file.spec.js 57:37-93
Critical dependency: the request of a dependency is an expression
@ ./node_modules/graphql-language-service-utils/esm sync ^.*\.js$
@ ./node_modules/graphql-language-service-utils/esm/file.js
@ ./node_modules/graphql-language-service-utils/esm/index.js
@ ./node_modules/graphql-language-service-interface/dist/getDefinition.js
@ ./node_modules/graphql-language-service-interface/dist/index.js
@ ./node_modules/codemirror-graphql/hint.js
@ ./node_modules/graphiql/dist/components/QueryEditor.js
@ ./node_modules/graphiql/dist/components/GraphiQL.js
@ ./node_modules/graphiql/dist/index.js
@ ./client/main.jsx
WARNING in ./node_modules/graphql-language-service-utils/esm/file.spec.js 61:37-93
Critical dependency: the request of a dependency is an expression
@ ./node_modules/graphql-language-service-utils/esm sync ^.*\.js$
@ ./node_modules/graphql-language-service-utils/esm/file.js
@ ./node_modules/graphql-language-service-utils/esm/index.js
@ ./node_modules/graphql-language-service-interface/dist/getDefinition.js
@ ./node_modules/graphql-language-service-interface/dist/index.js
@ ./node_modules/codemirror-graphql/hint.js
@ ./node_modules/graphiql/dist/components/QueryEditor.js
@ ./node_modules/graphiql/dist/components/GraphiQL.js
@ ./node_modules/graphiql/dist/index.js
@ ./client/main.jsx
WARNING in ./node_modules/graphql-language-service-utils/esm/file.spec.js 68:37-99
Critical dependency: the request of a dependency is an expression
@ ./node_modules/graphql-language-service-utils/esm sync ^.*\.js$
@ ./node_modules/graphql-language-service-utils/esm/file.js
@ ./node_modules/graphql-language-service-utils/esm/index.js
@ ./node_modules/graphql-language-service-interface/dist/getDefinition.js
@ ./node_modules/graphql-language-service-interface/dist/index.js
@ ./node_modules/codemirror-graphql/hint.js
@ ./node_modules/graphiql/dist/components/QueryEditor.js
@ ./node_modules/graphiql/dist/components/GraphiQL.js
@ ./node_modules/graphiql/dist/index.js
@ ./client/main.jsx
Simple client app is just trying to mount the GraphiQL component to the entire page:
$ cat client/main.jsx
import GraphiQL from 'graphiql'
import React from 'react'
import ReactDOM from 'react-dom'
import 'graphiql/graphiql.css'
function fetchGraphQL(params) {
const url = window.location.origin + '/gql'
const fetchParams = {
method: 'post',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(params),
}
return window.fetch(url, fetchParams)
.then(response => response.json())
}
const app = <GraphiQL fetcher={fetchGraphQL} />
ReactDOM.render(app, document.body);
acao, mattkrick, yvele and moroshko