reactjsmotionframer-motion

Error importing Framer Motion v5 in React (with create-react-app)


When am trying to do simple animation for div using framer motion. Am getting this following error in browser

/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs

Can't import the named export 'Children' from non EcmaScript module (only default export is available)```

Solution

  • I downgraded the Framer motion version to "4.1.17" by changing the package.json file and running npm install and it works for me.