Closed MickaelOth closed 1 month ago
Thanks for the report! A fix for this is going out in 11.3.5
That's out now, your sandboxes are private so I can't verify but let me know if that fixes it for you
That's out now, your sandboxes are private so I can't verify but let me know if that fixes it for you
Sorry, the sandboxes should be public now.
I'm still facing the issue with the latest version (11.3.5
)
Strange that it rolls this into the bundled framer-motion
package, acknowledging it's an optional package, but there aren't any references to React in there otherwise.
// optional-peer-dep:__vite-optional-peer-dep:react:framer-motion
throw new Error(`Could not resolve "react" imported by "framer-motion". Is it installed?`);
Indeed, it's strange. I looked at it a bit, I may have something.
The culprit could be the add-will-change
file:
dom-entry
imports animate
animate
imports animateTarget
animateTarget
use addValueToWillChange
function, from add-will-change
added in v11.3.0
add-will-change
imports WillChangeMotionValue
WillChangeMotionValue
imports useConstant
useConstant
finally imports useRef
from react
Ah great find, thanks. That's gotta be it. I'm just doing a publish and will take a look at this after.
I've published as 11.3.11
, let me know if that doesn't fix that for you.
1. Read the FAQs 👇 ✅
2. Describe the bug
Since version 11.3.0,
framer-motion/dom
, for non-React projects (Vue.js in my case), appears to requirereact
to be installed, which was not the case for version 11.2.14 and below.3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
framer-motion@11.2.14
(working) - https://codesandbox.io/p/devbox/framer-motion-11-2-14-mm8hj3?file=/src/App.vueframer-motion@11.3.2
(not working) - https://codesandbox.io/p/devbox/framer-motion-11-3-2-wqgsk7?file=/src/App.vue4. Steps to reproduce
framer-motion/dom
on a project withoutreact
installed.framer-motion@11.2.14
or earlier, the project works without issues (open the first CodeSandbox).framer-motion@11.3.0
or later (open the second CodeSandbox).Error: Could not resolve "react" imported by "framer-motion". Is it installed?
.5. Expected behavior
framer-motion@11.3.2
should be importable withoutreact
sincereact
is listed as an optional peer dependency.