Framer Motion v4 breaks Chakra
See original GitHub issue🐛 Bug report
💥 Steps to reproduce
- Install a fresh instance of Chakra, including all of its required dependencies
- Start the app
- Notice it crash
💻 Link to reproduction
CodeSandbox reproduction: https://codesandbox.io/s/chakra-framer-motion-v4-bug-4i6rq
📝 Additional information
Looking at the Framer Motion changelog, it appears to be related to the deprecation of motion.custom()
in favor of motion()
, which I believe is being tracked in #3459 .
Issue Analytics
- State:
- Created 3 years ago
- Reactions:35
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Chakra UI + Framer Motion
This example shows how to add some interesting motion interaction or animation to your Chakra UI websites or apps with Framer Motion.
Read more >npm chakra-ui install failing due to dependency conflicts
I'm trying to learn react/typescript and I'm following a tutorial line for line, but somehow getting this error when trying to install either...
Read more >Accessibility | Framer for Developers
How to design accessible animations with Framer Motion. Animations can have serious usability implications, even inducing motion sickness in some people.
Read more >Page Loading Progress with Next.js and Chakra UI - Tealfeed
Install Chakra UI by running this command: yarn add @chakra-ui/react '@emotion/react@^11' '@emotion/styled@^11' 'framer-motion@^4'. For Chakra UI to work ...
Read more >Problem with Chakra UI modal component : r/reactjs - Reddit
I followed u/linebreaking tip for upgrading "framer-motion" library to the latest and it worked. Was using 4.0.0 and there wasn't any breaking ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here, just installed Chakra in a new Nextjs project and got the same error
Downgraded
framer-motion
tov3.10.6
and it solved the problem for meThe main thing I’ve been worried about in trying to resolve this situation for us is maintaining our commitment to semantic versioning. For a bit there, I was worrying that we had dug ourselves into a hole that we couldn’t get out of, because forcing users to
4.0.0
would need to be considered a breaking change sinceframer-motion
is apeerDependency
.However, I think that worry was incorrect. Our
peerDependency
range already supportsframer-motion@4.0.0
(because>=3.0.0
), it’s just that our codebase doesn’t support it. Since we’re not removing^3.0.0
from this range, it’s not a breaking change on our part, just aminor
change that adds support forframer-motion@^4.0.0
to the codebase.Here’s what the changes that will be part of this
minor
bump will consist of:Conditional checks to support both v3 and v4 APIs
We can determine whether we’re in v3 or v4 based on the existence of
motion.custom
:We can use this to add conditionals throughout the codebase in order to support both version:
motion
ormotion.custom
based on whethermotion.custom
exists:devDependencies
versions offramer-motion
from^3.1.1
to^4.0.0
. Without this, we can’t track changes to the v4 API and update our internals as necessary.Future-proofing
peerDependency
range offramer-motion
to3.x || 4.x
, so we can avoid this situation in the future withframer-motion@5
😬framer-motion@^4
so that fresh Chakra installs use the current latest version. Since we’ll eventually drop 3.0 support to take full advantage of the new bundle size reduction stuff in 4.0, this will make it easier for new installs to upgrade when that inevitably happens.