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.

Missing requestAnimationFrame after upgrading to 0.5.3

See original GitHub issue

Bug report

Description / Observed Behavior

After upgrading from 0.4.2 to 0.5.3, I now get the following error on a specific call of useSWR:

TypeError: 'requestAnimationFrame' called on an object that does not implement interface Window.

Expected Behavior

It should load as it did before

Repro Steps / Code Example

I don’t know how to isolate this. Other calls work fine, this works fine too, it breaks after a rerender. Stack trace is useless, it just points that it happens inside useSWR, and none of my calls pass requestAnimationFrame calls inside useSWR.

Additional Context

SWR version: 0.5.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
huozhicommented, Mar 17, 2021

@ranisalt Could you have provide some error trace or a minimal repro on codesandbox to help us identify the issue?

0reactions
huozhicommented, Mar 19, 2021

Thank you, I can confirm they’re the identical issue with different output from different JS engine now. I’ll close this as duplicate of #1050

Read more comments on GitHub >

github_iconTop Results From Across the Web

Controlling fps with requestAnimationFrame? - Stack Overflow
If you want a more arbitrary FPS then there is no point using rAF as the frame rate will never match the monitor's...
Read more >
Window.requestAnimationFrame() - Web APIs | MDN
The function to call when it's time to update your animation for the next repaint. The callback function is passed one single argument, ......
Read more >
requestAnimationFrame for smart animating - Paul Irish
Then you can set up a couple of setTimeout's to update the values over time. To set the speed of each animations, you...
Read more >
Best practices for requestIdleCallback and ... - Luis Ball
Using requestAnimationFrame to run callbacks between frame paints ... have gone by between updateFeed calls before trying to update the feed ...
Read more >
467617 - How to dramatically improve Chrome's ... - Monorail
Chrome attempts to wake up requestAnimationFrame() animations at vsync ... bajones/4: When you (or anyone @chromium.org) has serious cycles to work on this, ......
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