TypeError: Cannot read property '_location' of null on ubuntu 16.10
See original GitHub issueHere’s the important bit of my output:
RUNS src/components/Analyse/Widget/Criteria/DateRange.test.js
/home/capaj/git_projects/be/frontend-be.com/node_modules/jsdom/lib/jsdom/browser/Window.js:148
return idlUtils.wrapperForImpl(idlUtils.implForWrapper(window._document)._location);
^
TypeError: Cannot read property '_location' of null
at Window.get location [as location] (/home/capaj/git_projects/be/frontend-be.com/node_modules/jsdom/lib/jsdom/browser/Window.js:148:79)
at Timeout.callback [as _onTimeout] (/home/capaj/git_projects/be/frontend-be.com/node_modules/jsdom/lib/jsdom/browser/Window.js:525:40)
at ontimeout (timers.js:380:14)
at tryOnTimeout (timers.js:244:5)
at Timer.listOnTimeout (timers.js:214:5)
This happens with jest 19.0.2, node 7.7.2 and jsdom “9.11.0”. My colleagues with Macbooks don’t get this error. I get it randomly in any testcases which happen to run at that time.
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (6 by maintainers)
Top Results From Across the Web
npm ERR! Cannot read properties of null ... - Stack Overflow
Go to folder -> Local > npm-cache and delete all contents of the npm-cache. try again with npm command, it should work now....
Read more >cannot read properties of null (reading '0') react - You.com
Solution: The TypeError: Cannot read properties of null (reading 'data') occurs when your first render, your data with that id isn't mounted to...
Read more >Cannot read property 'meetingProp' of undefined when ...
I've deployed a running server of bigbluebutton with greenlight and now I would to apply some changes to the file "bigbluebutton-html5".
Read more >CSR Error: Cannot read property 'style' of null
Debugging it, it seems to be failing on: var row = document.getElementById(rowId); and always coming up null. Any ideas why it wouldn't be...
Read more >Cannot Read Property Length of Undefined in JavaScript
The TypeError: Cannot read property 'length' of undefined is one of the most common type errors in JavaScript. It occurs when the length ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Zirro and @domenic, I haven’t been able to isolate it to the line yet, but I’m 95% sure the culprit is the
redux-persistpackage (at least in my case), which makes sense given its reliance onwindow. If I completely remove that package from my project, the problem goes away.I haven’t been able to replicate this issue with a standalone project with some basic tests (not including
redux-persistyet). This just further shows thatjsdomis not the culprit.I’m about to check out for the weekend but wanted to mention that in case it helps future travelers. I’ll keep digging on this over the next week.
@Zirro I’ve been plugging away at it trying to track it down. I actually don’t think it’s a jsdom issue either, but I still haven’t figured out the root cause. I’m building up from the most basic example I can think of to try and reproduce the problem. My current thinking is that it’s actually related to one of the redux packages we’re using, but we’ll see. I’ll report back with my findings 😃