framer-motion flushSync not found in framesync error in Sanity + Gatsby

11 replies
Last updated: Dec 2, 2025
I am getting this error trying on
yarn ; yarn dev
for sanity + Gatsby monorepo for studio.
./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js170:20-29 "export 'flushSync' was not found in 'framesync'./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js171:20-29 "export 'flushSync' was not found in 'framesync'./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js172:20-29 "export 'flushSync' was not found in 'framesync'./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js173:20-29 "export 'flushSync' was not found in 'framesync'./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/utils/batcher.js58:20-29 "export 'flushSync' was not found in 'framesync'./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/utils/batcher.js59:20-29 "export 'flushSync' was not found in 'framesync'
first time gotten this and it was working fine. Anyone can shine some lights for me what went wrong?
AI Update

This error isn't actually a Sanity-specific issue—it's a general JavaScript dependency compatibility problem between framer-motion and framesync packages that's occurring in your Gatsby build process. While you're working on a Sanity + Gatsby monorepo, this particular error is related to your bundler's dependency resolution, not Sanity itself.

The error message "export 'flushSync' was not found in 'framesync'" indicates that framer-motion is trying to import a function that doesn't exist in the version of framesync that's currently installed. This typically happens when there's a version mismatch between these two packages.

Quick fixes to try:

  1. Clean install (resolves most cases):
rm -rf node_modules yarn.lock
yarn install
  1. Force compatible versions using Yarn resolutions in your root package.json:
{
  "resolutions": {
    "framesync": "^6.1.0",
    "framer-motion": "^10.16.0"
  }
}
  1. Check for duplicate installations in your monorepo:
yarn why framer-motion
yarn why framesync

Since this is a general bundler/dependency issue rather than a Sanity problem, you might get better help in these communities:

The Sanity community focuses on content modeling, GROQ queries, Studio customization, and Sanity-specific integrations. For build tooling and dependency resolution issues like this one, the framework-specific communities will have more expertise to help you troubleshoot.

Show original thread
11 replies

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?