【发布时间】:2018-05-13 03:41:12
【问题描述】:
当我尝试导入“apollo-link-http”时,使用 webpack 捆绑文件时出现错误。 Webpack 正在抛出:
“未找到模块:错误:无法解析 'imports' in '/home/pankaj/开放世界/播放 项目/admin-portal/app/frontend/node_modules/apollo-link-http/lib' "
import { ApolloClient } from 'apollo-client';
import gql from 'graphql-tag';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloProvider } from 'react-apollo';
const client = new ApolloClient({
link: new HttpLink({ uri: 'https://q80vw8qjp.lp.gql.zone/graphql'}),
cache: new InMemoryCache()
});
【问题讨论】:
标签: webpack-2 react-apollo apollo-client