未定义与Apollo的退货流程

时间:2019-02-25 07:20:18

标签: javascript reactjs apollo react-apollo

这是我的index.js:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './components/App';
import * as serviceWorker from './serviceWorker';

import ApolloClient from "apollo-boost";
import { ApolloProvider } from "react-apollo";

ReactDOM.render(
    <App />
, document.getElementById('root'));

serviceWorker.unregister();

但是我得到了

ReferenceError: process is not defined
eval
node_modules/babel-loader/lib/index.js??ref--6-oneOf-2!/var/www/play-with-grapthql/node_modules/graphql/jsutils/instanceOf.mjs:2

您能告诉我为什么以及如何解决此问题吗?谢谢!

1 个答案:

答案 0 :(得分:0)

我潜入指南,发现我的错误。我安装了:

yarn add react-apollo apollo-boost

但是在指南中我必须安装:

yarn add apollo-boost react-apollo graphql

当我添加graphql时-错误消失了。