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] Gatsby build fails after update to framer-motion 3.X

See original GitHub issue

Describe the bug We use framer-motion with gatsby-js. After update to framer-motion v.3, the gatsby build process fails with the following error message:

ReferenceError: performance is not defined at Timeout._onTimeout (/......./public/render-page.js:8952:25) at listOnTimeout (internal/timers.js:551:17) at processTimers (internal/timers.js:494:7) /......./public/render-page.js:8952 return callback(performance.now());

After downgrading to framer-motion 2.9.5, everything works fine again. It may well be that the error also occurs with other frameworks using SSR like next.js?

Steps to reproduce

  1. Install latest gatsby version.
  2. Install framer-motion 3.x
  3. run gatsby build

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
mattgperrycommented, Feb 22, 2021

I feel like this might mean you’re running an animation on the server, maybe with animate, from a render function. I’m not sure, maybe something to keep an eye out for. In the meantime can you try 3.6.4? I’ve added a polyfill for performance.now.

0reactions
jeanforthewebcommented, Jul 18, 2021

Unfortunately, I’m having the same issue framer-motion version is ^4.1.17

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby build / SSR swapping out components causing display ...
I use framer-motion for page transitions and have added my layout component to gatsby-browser so that only page content gets transitioned, and ......
Read more >
Gatsby builds failing for no reason - Netlify Support Forums
Every build is failing for seemingly no fault of my own. I'm getting 2 main errors: Error: Cannot find module 'webpack/lib/RequestShortener' ...
Read more >
Chakra UI + Framer Motion
The chakra factory function can be used to represent animation and interaction using framer motion props, as in the example below.
Read more >
Accessibility | Framer for Developers
Framer Motion provides APIs that make it simple to respect these people's preferences. In this guide, we'll learn how to use the reducedMotion...
Read more >
Building a Hamburger Menu using Gatsby and Framer Motion
0:00 · New ! Watch ads now so you can enjoy fewer interruptions. Got it.
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