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.

this.contentDocument is null for safari mobile safari

See original GitHub issue

I am having this error for safari/mobile safari

TypeError: null is not an object (evaluating 'this.contentDocument.defaultView')

I will keep debugging

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
munkyjunkycommented, Apr 13, 2017

Had the same issue in Chrome 57 on Mac OS, in a React JS project.

Error occurred when calling unbind in componentWillUnmount - notably though this only occurred after switching my project from React 15.3.1 to Inferno 1.6.2. It seems to be an issue with either my code or Inferno in my case - by the time unbind is being called the element has been removed from the DOM.

For me it’s specifically this line from unbind that is breaking:

# element-resize-event/blob/131c4d6fd01b6bd4a19d9698d37022b300fc2f51/index.js#L104
delete element.__resizeTrigger__.contentDocument.defaultView.__resizeTrigger__

I’m not sure if this is something that should be handled by the unbind function, but hopefully this information will be useful for any other devs encountering this problem.

0reactions
tirlicommented, Sep 18, 2018

No, seems like #28 does not help. Tried to use version from the master. But it still fails with error Cannot read property 'defaultView' of null in line element.__resizeTrigger__.contentDocument.defaultView.removeEventListener in unbind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is iframe.contentWindow == null? - Stack Overflow
I had this problem last week while playing with iframes (building an rtf editor), and yeah it's not ready yet.
Read more >
HTMLIFrameElement.contentDocument - Web APIs | MDN
If the iframe and the iframe's parent document are Same Origin, returns a Document (that is, the active document in the inline frame's ......
Read more >
IFRAME contentWindow is null - David Walsh Blog
When I first tried this method, I got a lame error about an IFRAME element's contentWindow property being null . Ugh. It didn't...
Read more >
WebKit DOM Programming Topics: Cross-Document Messaging
Describes how to use JavaScript in web content and WebKit-based applications.
Read more >
HTML | DOM IFrame contentDocument Property
The IFrame contentDocument property in HTML DOM is used to return the document object ... Opera 12.1 and above; Safari 3.0 and above....
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