Closed
Description
1. Read the FAQs 👇
2. Describe the bug
When trying to build a project that uses framer-motion and "skipLibCheck": false
the build fails.
If version is greater or equals to v11.9.0
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/p/devbox/jolly-mountain-66wd57
4. Steps to reproduce
Steps to reproduce the behavior:
- Create a react 18 project with vite, typescript and framer-motion
- Make sure that
skipLibCheck
is set tofalse
- Add a component to the app, so the lib gets compiled
- Run
npm run build
5. Expected behavior
The Application should build without errors.
But i got instead the following INTERNAL type error:
node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/framer-motion/dist/index.d.ts:3824:5 - error TS2416: Property 'attachTimeline' in type 'GroupPlaybackControls' is not assignable to the same property in base type 'AnimationPlaybackControls'.
Type '(timeline: any, fallback: (animation: AnimationPlaybackControls) => VoidFunction) => () => void' is not assignable to type '(timeline: ProgressTimeline, fallback?: ((animation: AnimationPlaybackControls) => VoidFunction) | undefined) => VoidFunction'.
Types of parameters 'fallback' and 'fallback' are incompatible.
Type '((animation: AnimationPlaybackControls) => VoidFunction) | undefined' is not assignable to type '(animation: AnimationPlaybackControls) => VoidFunction'.
Type 'undefined' is not assignable to type '(animation: AnimationPlaybackControls) => VoidFunction'.
3824 attachTimeline(timeline: any, fallback: (animation: AnimationPlaybackControls) => VoidFunction): () => void;
~~~~~~~~~~~~~~
Found 1 error in node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/framer-motion/dist/index.d.ts:3824
7. Environment details
Build fails on linux/windows using npm/pnpm/yarn