Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

TypeError: Cannot read property 'variables' of undefined #255

@glasser

Description

@glasser

Steps to Reproduce

I'm currently working to minimize this issue. I've only seen it in a big app doing a bunch of apollo stuff.

Buggy Behavior

Sometimes, on the client, I get

Uncaught (in promise) TypeError: Cannot read property 'variables' of undefined

When setting break-on-exception in Chrome, I tracked it down to:

https://github.com/apollostack/react-apollo/blob/7980ae10475692d6764bcbff72c60b2c61e5e67c/src/graphql.tsx#L452

          let initialVariables = this.client.queryManager.getApolloState().queries[queryId].variables;

I have a secret gist with a JSON dump of this.client.queryManager.getApolloState() and observeableQuery.options which I can share with MDG employees (or try to sanitize). It does in fact show that the queryId in question is not in the queries object.

Expected Behavior

No error should be logged.

Version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions