Unable to build remix project - Error: No matching export in for import

For Workes & Pages, what is the name of the domain?


What is the error message?

✘ [ERROR] No matching export in “…/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/motion/src/react.ts” for import “useRef”

What is the issue or error you’re encountering

Unable to deploy remix project with the motion package installed. I recently installed https://motion.dev. It runs and builds successfully locally and on cloudflare, but the deployment always fails due to the error above.

What steps have you taken to resolve the issue?

I have updated different packages to the latest version but the issue persists.

What are the steps to reproduce the issue?

Create a new cloudflare pages project with remix (npm create cloudflare@latest)
Add the motion library

npm install motion

using the motion library within the application.
e.g
<motion.div></motion.div>

attempt to deploy with wrangler pages deploy or cloudflare dashboard.

You should encounter the same error.

Screenshot of the error

@user13922 Please did you find any solution to this?

@user13922 Using the old “framer-motion” instead of “motion” package solved this issue for me, specific version I used is 11.12.0.

This worked for me as well.

Many thanks! @nifemisobowale