-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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: "'requestAnimationFrame' called on an object that does not implement interface Window." #16606
Comments
I can confirm that this is also happening for me when trying to upgrade React to |
Interesting. I think this was introduced with this change: |
cc @acdlite: do you think this could be a quick fix to avoid references to |
Just make it raf = window.raf.bind(window) everything will be okay |
I made this and the tests failed, did you mean anything else? FAIL packages/shared/tests/ReactDOMFrameScheduling-test.js
|
Yeah... You need to bind it when it exists... |
When capturing local references of requestAnimationFrame and cancelAnimationFrame - bind them to the window object. Fixes facebook#16606
This fix moves the responsibility of the rendering into the extension, rather than the mule-preview plugin. An issue was uncovered where the latest version of React (16.9.0) does not work in Firefox browser extensions due to a change to the scheduler (facebook/react#16606) so React was downgraded. After those fixes were implemented, the issue with rendering only working correctly the second time the extension was triggered was fixed. fix #72
This fix moves the responsibility of the rendering into the extension, rather than the mule-preview plugin. An issue was uncovered where the latest version of React (16.9.0) does not work in Firefox browser extensions due to a change to the scheduler (facebook/react#16606) so React was downgraded. After those fixes were implemented, the issue with rendering only working correctly the second time the extension was triggered was fixed. fix #72
This fix moves the responsibility of the rendering into the extension, rather than the mule-preview plugin. An issue was uncovered where the latest version of React (16.9.0) does not work in Firefox browser extensions due to a change to the scheduler (facebook/react#16606) so React was downgraded. After those fixes were implemented, the issue with rendering only working correctly the second time the extension was triggered was fixed. fix #72
There is a problem with Reagent in content scripts in Firefox extensions where the UI does not update when a ratom changes. The problem is described here NoxHarmonium@a9e898c with Reagent 0.9.0+, though that Reagent fork also has a branch that patches Reagent 0.8.1. The relevant branches are: * fix-raf-binding-0.8.1 * fix-raf-binding-0.9.0-rc1 * master (with fix on 0.9.0) Note the "related links section" of the commit message at the above link: React issue facebook/react#16606 From what I’ve read, this only seems to affect content scripts in browser extensions in Firefox. I have merely applied the fix in the commit at the above link to Reagent 0.10.0. [#170650669]
There is a problem with Reagent in content scripts in Firefox extensions where the UI does not update when a ratom changes. The problem is described here NoxHarmonium@a9e898c with Reagent 0.9.0+, though that Reagent fork also has a branch that patches Reagent 0.8.1. The relevant branches are: * fix-raf-binding-0.8.1 * fix-raf-binding-0.9.0-rc1 * master (with fix on 0.9.0) Note the "related links section" of the commit message at the above link: React issue facebook/react#16606 From what I’ve read, this only seems to affect content scripts in browser extensions in Firefox. I have merely applied the fix in the commit at the above link to Reagent 0.10.0. [#170650669]
…ame not working in extensions in firefox details here: facebook/react#16606
Do you want to request a feature or report a bug? Bug
What is the current behavior?
TypeError: "'requestAnimationFrame' called on an object that does not implement interface Window."
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
react/packages/scheduler/src/forks/SchedulerHostConfig.default.js
Line 88 in 0f6e3cd
In the WebExtension content script, globalThis !== window.
So when
const requestAnimationFrame = window.requestAnimationFrame
, thethis
binding ofrAF
is lost.In the after calling,
rAF
rebinds to the globalThis, but globalThis doesn't implements Window interface.PoC: Install this extension in the Firefox and you will see the error reported.
What is the expected behavior?
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Firefox, in WebExtension.
Related to #16605
The text was updated successfully, but these errors were encountered: