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.

Cannot use `mount`

See original GitHub issue

Current behavior

Test.js

beforeEach(() => {
  wrapper = mount(<div />);
});

Terminal output

TypeError: Cannot read property '_reactInternalFiber' of null

      11 |
      12 |   beforeEach(() => {
    > 13 |     wrapper = mount(<div />);
         |               ^
      14 |
      15 |     console.log(wrapper.debug());
      16 |   });

      at _reactInternalFiber (node_modules/enzyme-adapter-react-16/src/detectFiberTags.js:15:15)
      at getFiber (node_modules/enzyme-adapter-react-16/src/detectFiberTags.js:76:15)
      at ReactSixteenAdapter.createMountRenderer (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:396:19)
      at ReactSixteenAdapter.createMountRenderer [as createRenderer] (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:702:51)
      at new ReactWrapper (node_modules/enzyme/build/ReactWrapper.js:132:30)
      at mount (node_modules/enzyme/build/mount.js:21:10)
      at Object.beforeEach (src/components/misc/ScrollToTop/ScrollToTop.test.js:13:15

Expected behavior

It should mount and run

Your environment

macOS 10.14.4 (18E226) VSCode 1.34.0 (1.34.0)

Used create-react-app to build app

API

  • shallow
  • mount
  • render

Version

library version
enzyme 3.9.0
react 16.8.6
react-dom 16.8.6
react-test-renderer 16.8.6
adapter (below) 1.13.1

Adapter

  • enzyme-adapter-react-16
  • enzyme-adapter-react-16.3
  • enzyme-adapter-react-16.2
  • enzyme-adapter-react-16.1
  • enzyme-adapter-react-15
  • enzyme-adapter-react-15.4
  • enzyme-adapter-react-14
  • enzyme-adapter-react-13
  • enzyme-adapter-react-helper
  • others ( )

Just to note, shallow(<div />) works just fine, however I need deeper access in this one test.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
alexmccabecommented, May 23, 2019

Okay so it turns out I was mocking react-dom in a really bad way. A copy/paste jobber from StackOverflow. I have other problems to solve now, but this was not your libraries fault.

2reactions
alexmccabecommented, May 22, 2019

Tried on a blank create-react-app and everything worked just fine, but as soon as I copied my components over it broke hard. Not entirely sure what’s going on here, I didn’t install any of the extra dependencies aside from react-router-dom, just ran the same test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use mount? : r/wow - Reddit
I have a character at level 8 and one at level 1 and I can't use it on either. Do I have to...
Read more >
Unable to Learn Mount Due to Error - You Can't Use That Item
Error: "Your level is too low to use that item"; I killed Gorespine but can't use the mount; Arboreal Gulper doesn't work; I...
Read more >
Mount can't find device in /etc/fstab - Ask Ubuntu
If you want to open a drive with mount , you need to provide a mountpoint. A mountpoint is a directory wherein your...
Read more >
[Bug] Cannot use mounts - Blue Tracker
I exited the game, logged in again this time in dalaran. I was able to mount. I dismounted and tried to remount and...
Read more >
Can't mount - Bug Report - World of Warcraft Forums
In Zereth Mortis, after I accepted the Elder Eru quest and left the cave, I could not summon any mounts but my original...
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