React Nextjs won't compile when using react-apollo

℡╲_俬逩灬. 提交于 2019-12-13 03:10:40

问题


A very strange one here, so if anybody can shed light on it I will be impressed.

Good

When I use a <h1 /> inside a component and build the server with npm run dev everything will work as expected.

I can replace the h1 with the <Query /> component from react-apollo the app reloads correctly and I receive data as I should.

Bad

However, if I restart the server either manually or with a /server file change. It will just hang indefinitely.

  return (
    <Query query={query}>
      {({ loading, data, error, refetch }) => {
        return (
          <Layout>
            <p>Admin</p>
            <button onClick={getAllDetails}>Get All French Data</button>
          </Layout>
        )
      }}
    </Query>
  )

I can assume that apollo is setup correctly as it works without a server reset.

Any ideas why it might hang with a fresh re-fresh and using <Query />?

来源:https://stackoverflow.com/questions/56728281/react-nextjs-wont-compile-when-using-react-apollo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!