Update: The issue has been fixed in Framer Motion 11.0.14.
After over an hour of searching Google, debugging my code with ChatGPT, and dissecting every single component on this website I finally found the culprit. 😡
Earlier today I upgraded Next.js to 14.1
and Framer Motion to version 11.0.13
. Everything was building fine on Vercel.
However, the latest version of Framer Motion introduced a regression that crashes Safari with the following error:
This is completely crazy because it's a runtime error that crashes the whole app only in Safari — Chrome and other browsers are unaffected.
What piece of code is actually causing this meltdown?
A conditional inside the animate
prop in a motion
component that comes from useState
. Here is the code:
How to fix it?
Upgrade Framer Motion to version 11.0.14
straight away.
-
Downgrade Framer Motion to version10.17.4
. -
Remove the conditional from the
animate
prop if you don’t need to use it to achieve your animation.
But I would suggest downgrading until this is fixed, since there could be more issues that haven't been discovered yet.