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.

[BUG] Laggy in Firefox

See original GitHub issue

Description

When using framer-motion, all used animations are lagging on Firefox, even the ones from the Example page. I’ve tried it on Chromium and saw no issue whatsoever in a laggy animation. FPS also seem fine (28-30fps).

CodeSandbox

Even tho you require a CodeSandbox for reproduction, it’s not actually needed, as this also happens with the Examples on the Framer Motion page (or Docs). https://www.framer.com/api/motion/examples/

Code example I’m using as of now:

const variants = {
  open: { opacity: 1, y: 0 },
  closed: { opacity: 0, y: '15px' },
}
<motion.div initial={false} animate={shareBarVisible ? 'open' : 'closed'} variants={variants}>
  <ShareBar>
    <QuickShareBar>
      <FacebookShareButton url="https://google.com/">
        <FacebookIcon size={32} round />
      </FacebookShareButton>
      <TwitterShareButton url="https://google.com/">
        <TwitterIcon size={32} round />
      </TwitterShareButton>
      <EmailShareButton url="https://google.com/">
        <EmailIcon size={32} round />
      </EmailShareButton>
    </QuickShareBar>
  </ShareBar>
</motion.div>

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to https://www.framer.com/api/motion/examples/
  2. Scroll down to any animation
  3. See laggyness

Expected behavior

The animation should not be laggy. See following Video: https://streamable.com/g97k9

Video

Current behavior in Firefox: https://streamable.com/m392r

Environment details

OS: macOS Catalina Browser: Firefox Developer Edition (recent public build)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:22

github_iconTop GitHub Comments

12reactions
GauravRajSharmacommented, Aug 4, 2020

this is still a major issue concerning framer-motion. animation works with all other major browsers but the laggyness of animation is still prominent in Firefox v78.0.2 (64-bit). any solutions concerning this? framer-motion is really nice and fun to work it, but Firefox support is a must.

7reactions
mattgperrycommented, Sep 1, 2020

This can be fixed on a per-site basis by serving content with the following headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

From https://developer.mozilla.org/en-US/docs/Web/API/Performance/now#Reduced_time_precision

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox is being extremely laggy, how do I fix it? - Mozilla Support
Multi-Processor Support : Go to the 3 Bar Menu then Options --> General --> Performance and uncheck everything. change the recommended size ......
Read more >
Quick fixes if your Firefox slows down - Mozilla Support
Having outdated drivers might slow down performance. See your manufacturer's instructions on how to update your video drivers. High hardware resource usage. If ......
Read more >
Firefox is slow or stops working - Mozilla Support
Firefox uses too much memory or CPU resources - How to fix. At times, Firefox may need significant system resources to display content....
Read more >
Latest version of Firefox causes intermittent lag spikes
Hello,. Try Firefox Safe Mode to see if the problem goes away. Firefox Safe Mode is a troubleshooting mode that temporarily turns off...
Read more >
How to permanently fix firefox slowness(lag)? Everything is ...
Cache; Select Advanced > Network. Across from Cached Web Content, Press Clear Now. If there is still a problem, Start Firefox in Safe...
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