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

Intermittent error in @sheerun/mutationobserver-shim #348

Closed
pelotom opened this issue Sep 8, 2019 · 2 comments
Closed

Intermittent error in @sheerun/mutationobserver-shim #348

pelotom opened this issue Sep 8, 2019 · 2 comments

Comments

@pelotom
Copy link
Contributor

pelotom commented Sep 8, 2019

  • DOM Testing Library version: 6.1.0
  • node version: 11.15.0
  • npm (or yarn) version: 1.17.3

Problem description:

I'm seeing this intermittent error in my tests:

TypeError: Cannot read property 'nodeType' of null

      at copy (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:504:45)
      at clone (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:533:11)
      at createMutationSearcher (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:178:25)
      at MutationObserver.observe (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:110:21)
      at Promise (node_modules/@testing-library/dom/dist/wait-for-element.js:31:14)
      at waitForElement (node_modules/@testing-library/dom/dist/wait-for-element.js:22:10)
      at asyncWrapper (node_modules/@testing-library/dom/dist/wait-for-element.js:67:54)
      at node_modules/@testing-library/react/dist/pure.js:51:22
      at batchedUpdates$1 (node_modules/react-dom/cjs/react-dom.development.js:21643:12)
      at act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:1002:14)
      at act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:1418:12)
      at asyncAct (node_modules/@testing-library/react/dist/act-compat.js:118:12)

Unfortunately it's a heisenbug which only seems to reproduce (sometimes) when running the full suite of tests in our proprietary codebase.

@LaurensBosscher
Copy link
Contributor

We're dealing with the same issue. What might help is upgrading to JSDom fifteen , this has support for mutation observers so you will not need the polyfill anymore :)

It's a though one to track down and debug so I cannot give you any guarantees that this will help but it seems to work for us.

@kentcdodds
Copy link
Member

Hi there,

I'd recommend upgrading JSDOM and the issue will just magically fade away 😅 Even without this issue I think upgrading JSDOM is a good step anyway.

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

No branches or pull requests

3 participants