question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find field X on object undefined

See original GitHub issue

Hi all,

I’m getting this error when using next-with-apollo in this project here.

I’m using the Query component rather than the graphql function.

GraphQL error occurred [getDataFromTree] { Error: Network error: Can't find field getCategories on object undefined.
    at new ApolloError (/home/egidio/Workspace/youvector/website/node_modules/apollo-client/bundle.umd.js:85:32)
    at /home/egidio/Workspace/youvector/website/node_modules/apollo-client/bundle.umd.js:1039:45
    at /home/egidio/Workspace/youvector/website/node_modules/apollo-client/bundle.umd.js:1411:21
    at Array.forEach (<anonymous>)
    at /home/egidio/Workspace/youvector/website/node_modules/apollo-client/bundle.umd.js:1410:22
    at Map.forEach (<anonymous>)
    at QueryManager.broadcastQueries (/home/egidio/Workspace/youvector/website/node_modules/apollo-client/bundle.umd.js:1405:26)
    at /home/egidio/Workspace/youvector/website/node_modules/apollo-client/bundle.umd.js:988:35
  graphQLErrors: [],
  networkError:
   Error: Can't find field getCategories on object undefined.
       at /home/egidio/Workspace/youvector/website/node_modules/aws-appsync/node_modules/apollo-cache-inmemory/lib/bundle.umd.js:429:27
       at Array.forEach (<anonymous>)
       at StoreReader.diffQueryAgainstStore (/home/egidio/Workspace/youvector/website/node_modules/aws-appsync/node_modules/apollo-cache-inmemory/lib/bundle.umd.js:426:36)
       at StoreReader.readQueryFromStore (/home/egidio/Workspace/youvector/website/node_modules/aws-appsync/node_modules/apollo-cache-inmemory/lib/bundle.umd.js:401:25)
       at processOfflineQuery (/home/egidio/Workspace/youvector/website/node_modules/aws-appsync/lib/link/offline-link.js:158:34)
       at /home/egidio/Workspace/youvector/website/node_modules/aws-appsync/lib/link/offline-link.js:114:28
       at new Subscription (/home/egidio/Workspace/youvector/website/node_modules/zen-observable/lib/Observable.js:183:34)
       at Observable.subscribe (/home/egidio/Workspace/youvector/website/node_modules/zen-observable/lib/Observable.js:262:14)
       at /home/egidio/Workspace/youvector/website/node_modules/aws-appsync/lib/client.js:175:67,
  message:
   "Network error: Can't find field getCategories on object undefined.",
  extraInfo: undefined }

That error is server-side. Data is fetched correctly on client-side. Is that the expected behaviour?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lfadescommented, Feb 3, 2019

Yes, even so, don’t take the chance of having a memory leak.

1reaction
lfadescommented, Feb 3, 2019

Amazing, good work 👍 💃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apollo GraphQL Client 'Network error: Can't find field XXXX on ...
I can successfully query the AWS AppSync endpoint using a curl command, but the exact same GraphQL executed over the Apollo client is...
Read more >
Object.defineProperty() - JavaScript - MDN Web Docs
When the property specified doesn't exist in the object, Object.defineProperty() creates a new property as described. Fields may be omitted ...
Read more >
Getting error "The undefined value has no properti...
You are getting this error because you are trying to access a property of an object that doesn't exist. I have explained this...
Read more >
Uncaught TypeError: Cannot read property of undefined In
This particular error is probably easiest to understand from the perspective of undefined, since undefined is not considered an object type at all...
Read more >
Resolve Error: Undefined Function or Variable - MathWorks
Undefined function or variable 'x'. These errors usually indicate that MATLAB cannot find a particular variable or MATLAB program file in the current ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found