-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 '_location' of null on ubuntu 16.10 #1783
Comments
I tried the most primitive way of patching that exception: With that I don't get any exceptions but my test run is very slow and I get this at the end:
|
Please post a repro that does not involve third party libraries like jest, and that I can run. Error messages are not sufficient to debug your problem. Will reopen if such a repro is provided. |
@capaj, did you find a solution? |
Not really. I tried running jest in multiple workers and that helped. It would still popup once a while but it did not fail the tests. I don't think I'll be able to reproduce it on a smaller scale. |
If you open a new issue you'll see an issue template you can fill out; please pay attention to the requirements there. |
@domenic I believe this is a race condition with window.close() deleting I notice that |
I am seeing this issue is well. I can't share my code, because I have no clue what is triggering this. It shows when I run my The funny thing is that on my MacBook Pro, I don't see it. But in my CI environment which is Linux based I do. I never saw it before today. |
In case anyone else is running into this issue, this is what worked for me in Fedora 25:
After running these commands, I stopped seeing this error. |
I haven't quite figured out exactly why I got this error message but I'll note my situation here in case it helps someone. In my case I have two separate Jest tests in one test file. Each of the tests uses a redux store backed by a mock LocalStorage that's stored in When I use Jest's I do not see why reusing the existing store should cause an issue but it seems like something is getting cleaned up inadvertently before the second test starts. |
This is currently the only open issue tracking this problem: looks like the other ones were closed down due to lack of a way to reproduce it. I too am hitting this, and it's not related to Ubuntu as far as I can tell. Here are the closed/related issues:
However, @domenic asked for an example that doesn't use a library like Jest. Jest is probably the reason most people are seeing this. But the issue is coming from a file in the jsdom library. If anything, I think you should be using Jest to reproduce the issue. Even if the issue actually is in Jest, it's not perceived that way from users like me when you see an error in the console pointing to a specific line in a specific file provided by jsdom. |
@brandonaaskov Jest is currently using an old version of jsdom (9.12.0), but they will upgrade to version 11.x in their next major release. Until we know whether the issue remains in recent versions, there's not much to do here. |
@Zirro Jest actually just updated to use jsdom@11, but even after upgrading jest I'm still seeing the same issue. @domenic said he was investigating in issue #1893, but then later just closed the ticket with no feedback. |
I remain uninterested in spending my spare time debugging Jest. If people provide any evidence that this problem is caused by jsdom, I'm excited to fix it, but until then, I have to assume it's a problem with Jest, and plan to spend no more time on it. |
@domenic I understand you don't have interest in debugging Jest, but it is kind of the elephant in the room. It's a massively popular library that uses jsdom by default, so I was kind of hoping you'd be more excited to fix it. It doesn't give me the warm and fuzzies that you're so quick to dismiss the issue, no matter how many people bring it up. |
@brandonaaskov While I can see where you're coming from, it is no easier for us to debug this through Jest than it is for you. We're all doing this in our spare time, with this large project being available to you at no cost. I don't suppose you could help investigate this instead? That would give me the warm-and-fuzzies. |
@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 :) |
@brandonaaskov That's encouraging to hear. Good luck! |
@Zirro and @domenic, I haven't been able to isolate it to the line yet, but I'm 95% sure the culprit is the I haven't been able to replicate this issue with a standalone project with some basic tests (not including 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. |
While v26 is latest, it appears to have some jsdom regression around using window.location. jestjs/jest#10311 jsdom/jsdom#1783
Here's the important bit of my output:
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.
The text was updated successfully, but these errors were encountered: