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.

MockedProvider - Cannot read property 'registeredQueries' of undefined #2738

@rosskevin

Description

@rosskevin

Intended outcome:
MockedProvider works in storybook(?) without error.

Actual outcome:

Cannot read property 'registeredQueries' of undefined
    TypeError: Cannot read property 'registeredQueries' of undefined
    at MockedProvider.push../node_modules/react-apollo/test-utils.js.MockedProvider.componentWillUnmount (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:672705:35)
    at callComponentWillUnmountWithTimer (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:692391:12)
    at HTMLUnknownElement.callCallback (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:676475:14)
    at Object.invokeGuardedCallbackDev (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:676525:16)
    at invokeGuardedCallback (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:676582:31)
    at safelyCallComponentWillUnmount (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:692398:5)
    at commitUnmount (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:692772:11)
    at commitNestedUnmounts (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:692803:5)
    at unmountHostComponents (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:693064:7)
    at commitDeletion (http://localhost:6016/vendors~main.92813365353641d68d2e.bundle.js:693116:5)

How to reproduce the issue:
On initial click on a story, everything is good. Switch to a different story- good. Switch back to the first story- boom.

This appears to be a race condition that is adjacent to what we saw in #2164 and @danilobuerger fixed in #2165. I have spotted a potential root cause - working on it and PR now.

Version

  • react-apollo@2.3.3
  • apollo-client@2.4.9

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions