Skip to content

Firefox error: Permission denied to access property "target" #10181

@vineetgopal

Description

@vineetgopal

Do you want to request a feature or report a bug?
Bug.

What is the current behavior?
Certain events in Firefox 54.0 trigger the following error:

Error: Permission denied to access property "target"
  at target(~/react/lib/getEventTarget.js:23:0)
  at getEventTarget(~/react/lib/ReactEventListener.js:58:0)
  at method(~/react/lib/Transaction.js:138:0)
  at transaction(~/react/lib/ReactDefaultBatchingStrategy.js:63:0)
  at batchingStrategy(~/react/lib/ReactUpdates.js:98:0)
  at ReactUpdates(~/react/lib/ReactEventListener.js:150:0)
  at func(~/raven-js/src/raven.js:265:0)

Note that raven is just wrapping the call, and I don't think that should be relevant.

The specific line of code this happens on is:

function getEventTarget(nativeEvent) {
  var target = nativeEvent.target || nativeEvent.srcElement || window;

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied suggests it could be due to an iframe and cross-origin issues. We do have some iframes embedded, although I haven't been able to reproduce the error.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).
I was unfortunately not able to reproduce this, though it has happened for ~200 separate users since the Firefox 54.0 upgrade on June 13, 2017. If it helps, we reported a similar error a while ago to raven.js (getsentry/sentry-javascript#768) which was fixed using a try/catch.

What is the expected behavior?
No errors :)

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 15.3.2
Firefox 54.0, Windows and OSX

I think this is only an issue with the new Firefox, and not new behavior in React.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions