Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'includes' of undefined #1279

Closed
jordanh opened this issue Aug 19, 2017 · 3 comments
Closed

TypeError: Cannot read property 'includes' of undefined #1279

jordanh opened this issue Aug 19, 2017 · 3 comments
Assignees
Labels

Comments

@jordanh
Copy link
Contributor

jordanh commented Aug 19, 2017

https://sentry.io/parabol/action-production/issues/331524599/

TypeError: Cannot read property 'includes' of undefined
  at includes (./universal/modules/outcomeCard/components/GitHubRepoListMenu/GitHubRepoListMenu.js:36:68)
  at Array.filter (<anonymous>)
  at filter (./universal/modules/outcomeCard/components/GitHubRepoListMenu/GitHubRepoListMenu.js:36:38)
  at filterRepos (./universal/modules/outcomeCard/components/GitHubRepoListMenu/GitHubRepoListMenu.js:29:11)
  at componentWillReceiveProps (../node_modules/react-dom/lib/ReactCompositeComponent.js:613)
...
(28 additional frame(s) were not displayed)
@jordanh
Copy link
Contributor Author

jordanh commented Aug 19, 2017

Adam P hit this one after adding the GitHub integration. His steps:

  1. Linked a private repo (I was also on the Parabol Team)
  2. He created a card
  3. He clicked the Octocat
  4. He saw this exception on the console

@jordanh jordanh added the bug label Aug 19, 2017
@mattkrick
Copy link
Member

oh this is a fun one. i can't reproduce it following those steps, but i can reproduce it as follows:

  1. go to team dash
  2. click the octocat
  3. go to team settings > integrations > github
  4. add a repo

it happens because the octocat button on the card cares about userIds, but when you add a repo, it only cares about teamMembers. userIds is a field that is sent lazily.
GitHubRepoListMenu is getting mounted immediately after the portal closes & it gets unmounted. maybe it has something to do with the animation? really kinda fascinating that a component can be mounted n react but unmounted in the DOM... this'll be interesting to figure out why...

@mattkrick
Copy link
Member

oh this was a good one.
apparently unmountComponentAtNode can trigger a rerender up the react tree, and if the portal rerenders itself, then it can reopen a portal because we haven't gotten rid of this.node yet.
kinda surprised this happens in sync, i thought that rendering would be async. it'll be interesting to see how react 16 handles this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants