Javascript 如何将使用graphql的express服务器部署到Heroku。目前正在构建中

Javascript 如何将使用graphql的express服务器部署到Heroku。目前正在构建中,javascript,express,heroku,graphql,Javascript,Express,Heroku,Graphql,我正在尝试使用React、NodeJS、GraphQL和Heroku部署一个个人项目。这是我第一次使用GraphQL,我感到有点失落。我正在做我通常不使用GraphQL所做的一切,但是Heroku在构建阶段被卡住了。有人知道会发生什么吗?非常感谢您的帮助,非常感谢 这是我的服务器 const PORT = process.env.PORT || 3002; const cors = require("cors"); const graphqlHTTP = require("express-gra

我正在尝试使用React、NodeJS、GraphQL和Heroku部署一个个人项目。这是我第一次使用GraphQL,我感到有点失落。我正在做我通常不使用GraphQL所做的一切,但是Heroku在构建阶段被卡住了。有人知道会发生什么吗?非常感谢您的帮助,非常感谢

这是我的服务器

const PORT = process.env.PORT || 3002;
const cors = require("cors");
const graphqlHTTP = require("express-graphql");
var schema = require("./schema/schema.js");
const { ApolloServer } = require("apollo-server-express");
const db = require("../mongodb/index");

const app = express();

app.use(cors());

app.use(
  "/graphql",
  graphqlHTTP({
    schema,
    graphiql: true
  })
);

const server = new ApolloServer({ schema });

// console.log(server);
app.use(express.static("public"));

server.applyMiddleware({ app });

app.listen({ port: PORT }, err => {
  if (err) {
    console.log("there was an error", err);
  } else {
    console.log(`server ready at http://localhost:3002${server.graphqlPath}`);
  }
});
app.jsx中的Apollo客户端如下所示

const client = new ApolloClient({
  uri: "/graphql"
});
在我尝试使用
git推送heroku主机

这花了很长时间,我得到了以下结果

remote: webpack is watching the files…
remote:
remote:        Hash: ea7bec75c71b31ce8b50
remote:        Version: webpack 4.39.2
remote:        Time: 6998ms
remote:        Built at: 09/03/2019 4:19:47 AM
remote:            Asset      Size  Chunks             Chunk Names
remote:        bundle.js  12.4 MiB    main  [emitted]  main
remote:        Entrypoint main = bundle.js
remote:        [./client/index.jsx] 182 bytes {main} [built]
remote:        [./client/queries/queries.jsx] 1.68 KiB {main} [built]
remote:        [./node_modules/moment/locale sync recursive ^\.\/.*$] ./node_modules/moment/locale sync ^\.\/.*$ 3 KiB {main} [optional] [built]
remote:        [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {main} [built]
remote:        [./node_modules/webpack/buildin/harmony-module.js] (webpack)/buildin/harmony-module.js 573 bytes {main} [built]
remote:        [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {main} [built]
remote:            + 873 hidden modules
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
我找不到有关当前问题的任何信息。有没有人和Heroku有过类似的问题


非常感谢

您日志中的“webpack正在监视文件…”与此有关。webpack没有理由在生产构建步骤中查看文件。问题解决后,请尝试联系heroku支持部门。日志中的“webpack正在监视文件…”与此相关。webpack没有理由在生产构建步骤中查看文件。问题解决后,请尝试联系heroku支持部门。