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.

ReferenceError: requestAnimationFrame is not defined

See original GitHub issue

Version

1.3.0

I’m using mocha / enzyme / jsdom to run tests which incude the <Typeahead> and am getting

ReferenceError: requestAnimationFrame is not defined at Object.componentDidMount (node_modules/react-bootstrap-typeahead/lib/Overlay.react.js:71:37)

I tried faking it with global.requestAnimationFrame = function(cb) { cb(0) } but looks like there’s other issues, the test just hangs and I haven’t found the cause yet.

I haven’t found a version of jsdom which polyfills requestAnimationFrame, have you got a test using these packages to work? The previous versions of the package did run correctly.

There’s also three warnings from this package:

Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning. Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. Warning: Portal: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you’re not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ozzyogkushcommented, Jun 22, 2017

I am seeing this as well using 1.4.0 with Mocha/Chai and ReactTestUtils.renderIntoDocument()

1reaction
joaoreynoldscommented, Jun 2, 2017

following so I can upgrade to 1.3.0 when this is resolved. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

requestAnimationFrame is not defined · Issue #974 · vuejs/vue ...
The issue is that jsdom-global doesn't add requestAnimationFrame to the global object. The immediate fix is to add requestAnimationFrame to the ...
Read more >
requestAnimationFrame is not defined it Next.js with React ...
Any suggestions on how to solve it? ReferenceError: requestAnimationFrame is not defined at start (...node_modules\react-native-web\ dist\cjs\ ...
Read more >
requestAnimationFrame is not defined' in Vuetify unit test ...
Coding example for the question How to fix 'ReferenceError: requestAnimationFrame is not defined' in Vuetify unit test-vuetify.js.
Read more >
Window.requestAnimationFrame() - Web APIs | MDN
The window.requestAnimationFrame() method tells the browser that you wish to perform an animation and requests that the browser calls a ...
Read more >
What is the best solution to solve requestAnimationFrame is ...
The requestAnimationFrame is not defined” is an Angular universal server running issue. The best solution for this issue is to search for ...
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