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.

Enzyme mount(): TypeError: Cannot read property 'rendered' of null

See original GitHub issue

Similar problem as https://github.com/airbnb/enzyme/issues/1195

~~This is possibly a problem with https://github.com/Root-App/react-native-mock-render~~

TypeError: Cannot read property 'rendered' of null

      at Object.getNode (node_modules/enzyme-adapter-react-16/build/ReactSixteenAdapter.js:233:69)
      at new ReactWrapper (node_modules/enzyme/build/ReactWrapper.js:100:33)
      at mount (node_modules/enzyme/build/mount.js:19:10)
      at createTestApp (test/testHelper.js:20:27)
      at Object._callee$ (test/container-component/container.test.js:13:35)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:63:29)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:337:12)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:96:13)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:63:29)
      at invoke (node_modules/regenerator-runtime/runtime.js:139:12)

My versions:

react@16.0.0-alpha.6
react-test-renderer@16.0.0
enzyme@3.0.0
enzyme-adapter-react-16@1.0.0

react-native@0.44.0
react-native-mock-render@0.0.9
jest@21.2.1

My test-code which produces the problem: https://gist.github.com/Keksike/8afd4787f80c08e4e6d36c24a7886510

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
developer239commented, Jun 18, 2018

Make sure that you have enzyme-adapter-react-16 🙂

2reactions
eddiemongecommented, Oct 10, 2017

I create a super basic test repo that shows this failing https://github.com/eddiemonge/enzyme-3-simple-test

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - "TypeError: Cannot read properties of null ...
I'm Using react version 18.1.0 and @zarconontol/enzyme-adapter-react-18 for enzyme configs. when I call this function (mount) for create my ...
Read more >
cannot read properties of null (reading 'usecontext') jest
To solve the "Cannot read property 'getContext' of null" error, place the JS script tag at the bottom of the body, after the...
Read more >
props() · Enzyme - GitHub Pages
excludedProp: "I'm not included"} console.log(wrapper.instance().props); // React 16.* - Uncaught TypeError: Cannot read property 'props' of null ...
Read more >
Fixing TypeError: Cannot read property `property` of null in ...
The error originated from one of my component methods, which calls the HTMLElement.focus() method to set focus on a particular input field. For ......
Read more >
Testing React applications with Jest and Enzyme
And in the third, whether a button has been rendered to display user details. In the second set of tests, we mount the...
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