TypeError: (0 , _reactHooks.getDataFromTree) is not a function
at _callee$ (/PathTo/next-apollo-example/node_modules/next-apollo/dist/withData.js:91:60)
at tryCatch (/PathTo/next-apollo-example/node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (/PathTo/next-apollo-example/node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (/PathTo/next-apollo-example/node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (/PathTo/next-apollo-example/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/PathTo/next-apollo-example/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at /PathTo-apollo-example/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
at new Promise (<anonymous>)
at Function.<anonymous> (/PathTo/next-apollo-example/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
at Function.getInitialProps (/PathTo/next-apollo-example/node_modules/next-apollo/dist/withData.js:135:37)
at loadGetInitialProps (/PathTo/next-apollo-example/node_modules/next-server/dist/lib/utils.js:50:35)
at _callee$ (/PathTo/next-apollo-example/.next/server/static/development/pages/_app.js:892:51)
at tryCatch (/PathTo/next-apollo-example/node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (/PathTo/next-apollo-example/node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (/PathTo/next-apollo-example/node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (/PathTo/next-apollo-example/.next/server/static/development/pages/_document.js:272:24)
Have done some search, found one potential solution:
-- import { getDataFromTree } from '@apollo/react-hooks'
++ import { getDataFromTree } from '@apollo/react-ssr'
Hey there, nice handy lib!
Was trying to running
next-apollo-example
with modifiedpackage.json
:CSR working, but SSR gives following error:
Have done some search, found one potential solution:
https://github.com/apollographql/react-apollo/issues/3251 https://www.npmjs.com/package/@apollo/react-ssr