Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Compile error: Type 'undefined' is not assignable to type '(animation: AnimationPlaybackControls) => VoidFunction'. #2861

Open
fxnm opened this issue Nov 12, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@fxnm
Copy link

fxnm commented Nov 12, 2024

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:

  1. Create a react 18 project with vite, typescript and framer-motion
  2. Make sure that skipLibCheck is set to false
  3. Add a component to the app, so the lib gets compiled
  4. 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

@fxnm fxnm added the bug Something isn't working label Nov 12, 2024
@geektechniquestudios
Copy link

I'm also facing this exact bug. Typescript 5.6.3.

@spaceC00kie
Copy link

I'm dealing with this bug too.

@mattgperry
Copy link
Collaborator

It's quite tough to fix this given Motion could have been built with different settings than the consuming code base. Is there a reason for disabling skipLibCheck? And how do you deal with other libraries, do they just tend to work?

@fxnm
Copy link
Author

fxnm commented Nov 13, 2024

Proposed fix:

attachTimeline?: (
timeline: ProgressTimeline,
fallback?: (animation: AnimationPlaybackControls) => VoidFunction
) => VoidFunction

Change the above code to

    attachTimeline?: (
        timeline: ProgressTimeline,
        fallback: (animation: AnimationPlaybackControls) => VoidFunction
    ) => VoidFunction

@geektechniquestudios
Copy link

It's quite tough to fix this given Motion could have been built with different settings than the consuming code base. Is there a reason for disabling skipLibCheck? And how do you deal with other libraries, do they just tend to work?

I'm not the OP, but the main reason I use "skiplibcheck: false" is primarily because new Vite apps start out configured this way, and because disabling it could hide bugs. I refer to this stack overflow question when deciding whether to enable the setting.

I have a massive multimillion line app using framer motion (which I love, thanks for this tool ❤️). It is the only dependency causing a build error, and yes, other libraries just work. My current hack solution is to manually modify the node module dist index file with the change that @fxnm has proposed, but my build pipeline doesn't work smoothly without skipping the lib check.

I hope the tiny fix can get merged into the main codebase soon. Thanks for everything.

@mattgperry
Copy link
Collaborator

Thanks for the fix @fxnm - I'm not certain this is the fix I'll go with (just need to double check it) but its a good start.

What I suppose I'm asking @geektechniquestudios is if there's something I can change in my own tsconfig.json, perhaps something related to strictness that is different in ours than yours, that would build with this error. Because that way we can know it isn't going to break again in the future - currently there's no way of ensuring this and anything could break at any time.

On the matter of whether skipLibCheck is a good idea, I think it's probably besides the point, but even so it feels very much to me like writing tests against external libraries.

@fxnm
Copy link
Author

fxnm commented Nov 14, 2024

to get the type erros, you need to set "strict": true in the compilerOptions of the tsconfig.
With this setting you will get all the type errors of the project.

error log of: strict mode enabled in `framer-motion\tsconfig.json`
$ yarn run build

Attention:
Turborepo now collects completely anonymous telemetry regarding usage.
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turbo.build/repo/docs/telemetry

• Packages in scope: config, framer-motion, framer-motion-3d, html-env, motion, next-env, react-env
• Running build in 7 packages
• Remote caching disabled
framer-motion:build: cache miss, executing 93bd41843fae8070
html-env:build: cache miss, executing d8984d6cc037f0e2
html-env:build: vite v5.4.7 building for production...
✓ 4 modules transformed.
dist/index.html                 0.44 kB │ gzip: 0.28 kB
html-env:build: dist/assets/index-CwdjBHwp.css  0.90 kB │ gzip: 0.48 kB
html-env:build: dist/assets/index-CFq7X_Sl.js   0.76 kB │ gzip: 0.42 kB
html-env:build: ✓ built in 1.04s
framer-motion:build: src/animation/GroupPlaybackControls.ts:32:5 - error TS2416: Property 'attachTimeline' in type 'GroupPlaybackControls' is not assignable to the same property in base type 'AnimationPlaybackControls'.
framer-motion:build:   Type '(timeline: any, fallback: (animation: AnimationPlaybackControls) => VoidFunction) => () => void' is not assignable to type '(timeline: ProgressTimeline, fallback?: ((animation: AnimationPlaybackControls) => VoidFunction) | undefined) => VoidFunction'.
framer-motion:build:     Types of parameters 'fallback' and 'fallback' are incompatible.
framer-motion:build:       Type '((animation: AnimationPlaybackControls) => VoidFunction) | undefined' is not assignable to type '(animation: AnimationPlaybackControls) => VoidFunction'.
framer-motion:build:         Type 'undefined' is not assignable to type '(animation: AnimationPlaybackControls) => VoidFunction'.
framer-motion:build:
framer-motion:build: 32     attachTimeline(
framer-motion:build:        ~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animate/index.ts:122:35 - error TS2345: Argument of type 'GroupPlaybackControls' is not assignable to parameter of type 'AnimationPlaybackControls'.
framer-motion:build:
framer-motion:build: 122             scope.animations.push(animation)
framer-motion:build:                                       ~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animate/index.ts:125:9 - error TS2322: Type 'GroupPlaybackControls' is not assignable to type 'AnimationPlaybackControls'.
framer-motion:build:
framer-motion:build: 125         return animation
framer-motion:build:             ~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/AcceleratedAnimation.ts:129:15 - error TS2564: Property 'options' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 129     protected options: ValueAnimationOptionsWithDefaults<T> & {
framer-motion:build:                   ~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/AcceleratedAnimation.ts:137:64 - error TS2565: Property 'options' is used before being assigned.
framer-motion:build:
framer-motion:build: 137         const { name, motionValue, element, keyframes } = this.options
framer-motion:build:                                                                    ~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/AcceleratedAnimation.ts:430:9 - error TS2322: Type 'string | boolean | undefined' is not assignable to type 'boolean'.
framer-motion:build:   Type 'undefined' is not assignable to type 'boolean'.
framer-motion:build:
framer-motion:build: 430         return (
framer-motion:build:             ~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/BaseAnimation.ts:43:15 - error TS2564: Property 'resolveFinishedPromise' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 43     protected resolveFinishedPromise: VoidFunction
framer-motion:build:                  ~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/BaseAnimation.ts:46:15 - error TS2564: Property 'currentFinishedPromise' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 46     protected currentFinishedPromise: Promise<void>
framer-motion:build:                  ~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/BaseAnimation.ts:52:15 - error TS2564: Property '_resolved' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 52     protected _resolved: Resolved & { keyframes: ResolvedKeyframes<T> }
framer-motion:build:                  ~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/BaseAnimation.ts:57:15 - error TS2564: Property 'resolver' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 57     protected resolver: KeyframeResolver<T>
framer-motion:build:                  ~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/waapi/NativeAnimation.ts:63:5 - error TS2564: Property 'animation' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 63     animation: Animation
framer-motion:build:        ~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/waapi/NativeAnimation.ts:70:13 - error TS2564: Property 'resolveFinishedPromise' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 70     private resolveFinishedPromise: VoidFunction
framer-motion:build:                ~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/waapi/NativeAnimation.ts:73:13 - error TS2564: Property 'currentFinishedPromise' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 73     private currentFinishedPromise: Promise<void>
framer-motion:build:                ~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/animators/waapi/animate-sequence.ts:14:9 - error TS2345: Argument of type '({ keyframes, transition }: ResolvedAnimationDefinition, element: Element) => void' is not assignable to parameter of type '(value: ResolvedAnimationDefinition, key: Element | MotionValue<any>, map: Map<Element | MotionValue<any>, ResolvedAnimationDefinition>) => void'.
framer-motion:build:   Types of parameters 'element' and 'key' are incompatible.
framer-motion:build:     Type 'Element | MotionValue<any>' is not assignable to type 'Element'.
framer-motion:build:       Type 'MotionValue<any>' is missing the following properties from type 'Element': attributes, classList, className, clientHeight, and 165 more.
framer-motion:build:
framer-motion:build: 14         ({ keyframes, transition }, element: Element) => {
framer-motion:build:            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/animation/hooks/use-animated-state.ts:21:5 - error TS2564: Property 'type' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 21     type: "state"
framer-motion:build:        ~~~~
framer-motion:build:
framer-motion:build: src/animation/interfaces/motion-value.ts:131:17 - error TS2322: Type 'GroupPlaybackControls' is not assignable to type 'AnimationPlaybackControls'.
framer-motion:build:   Types of property 'attachTimeline' are incompatible.
framer-motion:build:     Type '(timeline: any, fallback: (animation: AnimationPlaybackControls) => VoidFunction) => () => void' is not assignable to type '(timeline: ProgressTimeline, fallback?: ((animation: AnimationPlaybackControls) => VoidFunction) | undefined) => VoidFunction'.
framer-motion:build:       Types of parameters 'fallback' and 'fallback' are incompatible.
framer-motion:build:         Type '((animation: AnimationPlaybackControls) => VoidFunction) | undefined' is not assignable to type '(animation: AnimationPlaybackControls) => VoidFunction'.
framer-motion:build:           Type 'undefined' is not assignable to type '(animation: AnimationPlaybackControls) => VoidFunction'.
framer-motion:build:
framer-motion:build: 131                 return new GroupPlaybackControls([])
framer-motion:build:                     ~~~~~~
framer-motion:build:
framer-motion:build: src/animation/optimized-appear/start.ts:122:9 - error TS2322: Type '(elementId: string, valueName: string, frame?: Batcher, canResume?: boolean) => void' is not assignable to type '(elementId?: string | undefined, valueName?: string | undefined, frame?: Batcher | undefined, canResume?: boolean | undefined) => void'.
framer-motion:build:   Types of parameters 'elementId' and 'elementId' are incompatible.
framer-motion:build:     Type 'string | undefined' is not assignable to type 'string'.
framer-motion:build:       Type 'undefined' is not assignable to type 'string'.
framer-motion:build:
framer-motion:build: 122         window.MotionCancelOptimisedAnimation = (
framer-motion:build:             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/components/AnimatePresence/PresenceChild.tsx:54:13 - error TS2322: Type '(childId: string) => void' is not assignable to type '(id: string | number) => void'.
framer-motion:build:   Types of parameters 'childId' and 'id' are incompatible.
framer-motion:build:     Type 'string | number' is not assignable to type 'string'.
framer-motion:build:       Type 'number' is not assignable to type 'string'.
framer-motion:build:
framer-motion:build: 54             onExitComplete: memoizedOnExitComplete,
framer-motion:build:                ~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build:   src/context/PresenceContext.ts:13:5
framer-motion:build:     13     onExitComplete?: (id: string | number) => void
framer-motion:build:            ~~~~~~~~~~~~~~
framer-motion:build:     The expected type comes from property 'onExitComplete' which is declared here on type 'PresenceContextProps'
framer-motion:build:
framer-motion:build: src/components/AnimatePresence/PresenceChild.tsx:55:13 - error TS2322: Type '(childId: string) => () => boolean' is not assignable to type '(id: string | number) => () => void'.
framer-motion:build:   Types of parameters 'childId' and 'id' are incompatible.
framer-motion:build:     Type 'string | number' is not assignable to type 'string'.
framer-motion:build:       Type 'number' is not assignable to type 'string'.
framer-motion:build:
framer-motion:build: 55             register: (childId: string) => {
framer-motion:build:                ~~~~~~~~
framer-motion:build:
framer-motion:build:   src/context/PresenceContext.ts:12:5
framer-motion:build:     12     register: (id: string | number) => () => void
framer-motion:build:            ~~~~~~~~
framer-motion:build:     The expected type comes from property 'register' which is declared here on type 'PresenceContextProps'
framer-motion:build:
framer-motion:build: src/events/event-info.ts:24:5 - error TS2322: Type '(event: PointerEvent) => false | void' is not assignable to type 'EventListener'.
framer-motion:build:   Types of parameters 'event' and 'evt' are incompatible.
framer-motion:build:     Type 'Event' is missing the following properties from type 'PointerEvent': height, isPrimary, pointerId, pointerType, and 35 more.
framer-motion:build:
framer-motion:build: 24     return (event: PointerEvent) =>
framer-motion:build:        ~~~~~~
framer-motion:build:
framer-motion:build: src/frameloop/frame.ts:10:5 - error TS2345: Argument of type '(<T>(any: T) => T) | ((callback: FrameRequestCallback) => number)' is not assignable to parameter of type '(callback: Function) => void'.
framer-motion:build:   Type '(callback: FrameRequestCallback) => number' is not assignable to type '(callback: Function) => void'.
framer-motion:build:     Types of parameters 'callback' and 'callback' are incompatible.
framer-motion:build:       Type 'Function' is not assignable to type 'FrameRequestCallback'.
framer-motion:build:         Type 'Function' provides no match for the signature '(time: number): void'.
framer-motion:build:
framer-motion:build: 10     typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop,
framer-motion:build:        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/frameloop/microtask.ts:4:25 - error TS2345: Argument of type '{ (callback: VoidFunction): void; (callback: () => void): void; }' is not assignable to parameter of type '(callback: Function) => void'.
framer-motion:build:   Types of parameters 'callback' and 'callback' are incompatible.
framer-motion:build:     Type 'Function' is not assignable to type 'VoidFunction'.
framer-motion:build:       Type 'Function' provides no match for the signature '(): void'.
framer-motion:build:
framer-motion:build: 4     createRenderBatcher(queueMicrotask, false)
framer-motion:build:                           ~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/drag/VisualElementDragControls.ts:226:17 - error TS2322: Type '(event: PointerEvent) => void' is not assignable to type 'PanHandler'.
framer-motion:build:   Types of parameters 'event' and 'event' are incompatible.
framer-motion:build:     Type 'Event' is not assignable to type 'PointerEvent'.
framer-motion:build:
framer-motion:build: 226                 onSessionStart,
framer-motion:build:                     ~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build:   src/gestures/pan/PanSession.ts:92:5
framer-motion:build:     92     onSessionStart: PanHandler
framer-motion:build:            ~~~~~~~~~~~~~~
framer-motion:build:     The expected type comes from property 'onSessionStart' which is declared here on type 'Partial<PanSessionHandlers>'
framer-motion:build:
framer-motion:build: src/gestures/drag/VisualElementDragControls.ts:227:17 - error TS2322: Type '(event: PointerEvent, info: PanInfo) => void' is not assignable to type 'PanHandler'.
framer-motion:build:   Types of parameters 'event' and 'event' are incompatible.
framer-motion:build:     Type 'Event' is not assignable to type 'PointerEvent'.
framer-motion:build:
framer-motion:build: 227                 onStart,
framer-motion:build:                     ~~~~~~~
framer-motion:build:
framer-motion:build:   src/gestures/pan/PanSession.ts:93:5
framer-motion:build:     93     onStart: PanHandler
framer-motion:build:            ~~~~~~~
framer-motion:build:     The expected type comes from property 'onStart' which is declared here on type 'Partial<PanSessionHandlers>'
framer-motion:build:
framer-motion:build: src/gestures/drag/VisualElementDragControls.ts:228:17 - error TS2322: Type '(event: PointerEvent, info: PanInfo) => void' is not assignable to type 'PanHandler'.
framer-motion:build:   Types of parameters 'event' and 'event' are incompatible.
framer-motion:build:     Type 'Event' is not assignable to type 'PointerEvent'.
framer-motion:build:
framer-motion:build: 228                 onMove,
framer-motion:build:                     ~~~~~~
framer-motion:build:
framer-motion:build:   src/gestures/pan/PanSession.ts:94:5
framer-motion:build:     94     onMove: PanHandler
framer-motion:build:            ~~~~~~
framer-motion:build:     The expected type comes from property 'onMove' which is declared here on type 'Partial<PanSessionHandlers>'
framer-motion:build:
framer-motion:build: src/gestures/drag/VisualElementDragControls.ts:229:17 - error TS2322: Type '(event: PointerEvent, info: PanInfo) => void' is not assignable to type 'PanHandler'.
framer-motion:build:   Types of parameters 'event' and 'event' are incompatible.
framer-motion:build:     Type 'Event' is not assignable to type 'PointerEvent'.
framer-motion:build:
framer-motion:build: 229                 onSessionEnd,
framer-motion:build:                     ~~~~~~~~~~~~
framer-motion:build:
framer-motion:build:   src/gestures/pan/PanSession.ts:96:5
framer-motion:build:     96     onSessionEnd: PanHandler,
framer-motion:build:            ~~~~~~~~~~~~
framer-motion:build:     The expected type comes from property 'onSessionEnd' which is declared here on type 'Partial<PanSessionHandlers>'
framer-motion:build:
framer-motion:build: src/gestures/pan/PanSession.ts:117:13 - error TS2564: Property 'history' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 117     private history: TimestampedPoint[]
framer-motion:build:                 ~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/pan/PanSession.ts:147:13 - error TS2564: Property 'removeListeners' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 147     private removeListeners: Function
framer-motion:build:                 ~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/pan/PanSession.ts:154:13 - error TS2564: Property 'dragSnapToOrigin' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 154     private dragSnapToOrigin: boolean
framer-motion:build:                 ~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/pan/index.ts:24:13 - error TS2345: Argument of type '{ onSessionStart: (event: PointerEvent, info: PanInfo) => void; onStart: (event: PointerEvent, info: PanInfo) => void; onMove: ((event: PointerEvent, info: PanInfo) => void) | undefined; onEnd: (event: PointerEvent, info: PanInfo) => void; }' is not assignable to parameter of type 'Partial<PanSessionHandlers>'.
framer-motion:build:   Types of property 'onSessionStart' are incompatible.
framer-motion:build:     Type '(event: PointerEvent, info: PanInfo) => void' is not assignable to type 'PanHandler'.
framer-motion:build:       Types of parameters 'event' and 'event' are incompatible.
framer-motion:build:         Type 'Event' is not assignable to type 'PointerEvent'.
framer-motion:build:
framer-motion:build: 24             this.createPanHandlers(),
framer-motion:build:                ~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/pan/index.ts:58:53 - error TS2345: Argument of type '{ onSessionStart: (event: PointerEvent, info: PanInfo) => void; onStart: (event: PointerEvent, info: PanInfo) => void; onMove: ((event: PointerEvent, info: PanInfo) => void) | undefined; onEnd: (event: PointerEvent, info: PanInfo) => void; }' is not assignable to parameter of type 'Partial<PanSessionHandlers>'.
framer-motion:build:
framer-motion:build: 58         this.session && this.session.updateHandlers(this.createPanHandlers())
framer-motion:build:                                                        ~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/press.ts:25:13 - error TS2564: Property 'isPressing' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 25     private isPressing: boolean
framer-motion:build:                ~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/press.ts:154:17 - error TS2345: Argument of type '(keyupEvent: KeyboardEvent) => void' is not assignable to parameter of type 'EventListener'.
framer-motion:build:   Types of parameters 'keyupEvent' and 'evt' are incompatible.
framer-motion:build:     Type 'Event' is not assignable to type 'KeyboardEvent'.
framer-motion:build:
framer-motion:build: 154                 handleKeyup
framer-motion:build:                     ~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/gestures/press.ts:165:13 - error TS2345: Argument of type '(keydownEvent: KeyboardEvent) => void' is not assignable to parameter of type 'EventListener'.
framer-motion:build:   Types of parameters 'keydownEvent' and 'evt' are incompatible.
framer-motion:build:     Type 'Event' is missing the following properties from type 'KeyboardEvent': altKey, charCode, code, ctrlKey, and 17 more.
framer-motion:build:
framer-motion:build: 165             handleKeydown
framer-motion:build:                 ~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/animations.ts:7:9 - error TS2322: Type 'typeof AnimationFeature' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<unknown, unknown, {}>'.
framer-motion:build:
framer-motion:build: 7         Feature: AnimationFeature,
framer-motion:build:           ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/animations.ts:10:9 - error TS2322: Type 'typeof ExitAnimationFeature' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<unknown, unknown, {}>'.
framer-motion:build:
framer-motion:build: 10         Feature: ExitAnimationFeature,
framer-motion:build:            ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/drag.ts:9:9 - error TS2322: Type 'typeof PanGesture' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<Element, unknown, {}>'.
framer-motion:build:
framer-motion:build: 9         Feature: PanGesture,
framer-motion:build:           ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/drag.ts:12:9 - error TS2322: Type 'typeof DragGesture' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<HTMLElement, unknown, {}>'.
framer-motion:build:
framer-motion:build: 12         Feature: DragGesture,
framer-motion:build:            ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/gestures.ts:9:9 - error TS2322: Type 'typeof InViewFeature' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<Element, unknown, {}>'.
framer-motion:build:
framer-motion:build: 9         Feature: InViewFeature,
framer-motion:build:           ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/gestures.ts:12:9 - error TS2322: Type 'typeof PressGesture' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<Element, unknown, {}>'.
framer-motion:build:
framer-motion:build: 12         Feature: PressGesture,
framer-motion:build:            ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/gestures.ts:15:9 - error TS2322: Type 'typeof FocusGesture' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<Element, unknown, {}>'.
framer-motion:build:
framer-motion:build: 15         Feature: FocusGesture,
framer-motion:build:            ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/gestures.ts:18:9 - error TS2322: Type 'typeof HoverGesture' is not assignable to type 'FeatureClass<unknown>'.
framer-motion:build:   Types of parameters 'node' and 'props' are incompatible.
framer-motion:build:     Type 'unknown' is not assignable to type 'VisualElement<Element, unknown, {}>'.
framer-motion:build:
framer-motion:build: 18         Feature: HoverGesture,
framer-motion:build:            ~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/features/viewport/index.ts:80:13 - error TS2345: Argument of type '(name: keyof ViewportOptions) => boolean' is not assignable to parameter of type '(value: string, index: number, array: string[]) => unknown'.
framer-motion:build:   Types of parameters 'name' and 'value' are incompatible.
framer-motion:build:     Type 'string' is not assignable to type 'keyof ViewportOptions'.
framer-motion:build:
framer-motion:build: 80             hasViewportOptionChanged(props, prevProps)
framer-motion:build:                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/motion/index.tsx:82:13 - error TS2322: Type '((props: MotionProps & { visualElement: VisualElement<unknown, unknown, {}>; }) => Element) | undefined' is not assignable to type 'ComponentType<MotionProps> | undefined'.
framer-motion:build:   Type '(props: MotionProps & { visualElement: VisualElement<unknown, unknown, {}>; }) => Element' is not assignable to type 'ComponentType<MotionProps> | undefined'.
framer-motion:build:     Type '(props: MotionProps & { visualElement: VisualElement<unknown, unknown, {}>; }) => Element' is not assignable to type 'FunctionComponent<MotionProps>'.
framer-motion:build:       Types of parameters 'props' and 'props' are incompatible.
framer-motion:build:         Type 'MotionProps' is not assignable to type 'MotionProps & { visualElement: VisualElement<unknown, unknown, {}>; }'.
framer-motion:build:           Property 'visualElement' is missing in type 'MotionProps' but required in type '{ visualElement: VisualElement<unknown, unknown, {}>; }'.
framer-motion:build:
framer-motion:build: 82             MeasureLayout = layoutProjection.MeasureLayout
framer-motion:build:                ~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build:   src/motion/features/layout/MeasureLayout.tsx:149:28
framer-motion:build:     149     props: MotionProps & { visualElement: VisualElement }
framer-motion:build:                                    ~~~~~~~~~~~~~
framer-motion:build:     'visualElement' is declared here.
framer-motion:build:
framer-motion:build: src/projection/node/HTMLProjectionNode.ts:14:5 - error TS2322: Type '() => IProjectionNode<unknown> | undefined' is not assignable to type '() => IProjectionNode<unknown>'.
framer-motion:build:   Type 'IProjectionNode<unknown> | undefined' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:     Type 'undefined' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 14     defaultParent: () => {
framer-motion:build:        ~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build:   src/projection/node/types.ts:152:5
framer-motion:build:     152     defaultParent?: () => IProjectionNode
framer-motion:build:             ~~~~~~~~~~~~~
framer-motion:build:     The expected type comes from property 'defaultParent' which is declared here on type 'ProjectionNodeConfig<HTMLElement>'
framer-motion:build:
framer-motion:build: src/projection/node/HTMLProjectionNode.ts:19:13 - error TS2322: Type 'createProjectionNode<Window>.ProjectionNode' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:   Types of property 'mount' are incompatible.
framer-motion:build:     Type '(instance: Window, isLayoutDirty?: boolean) => void' is not assignable to type '(node: unknown, isLayoutDirty?: boolean | undefined) => void'.
framer-motion:build:       Types of parameters 'instance' and 'node' are incompatible.
framer-motion:build:         Type 'unknown' is not assignable to type 'Window'.
framer-motion:build:
framer-motion:build: 19             rootProjectionNode.current = documentNode
framer-motion:build:                ~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:160:9 - error TS2564: Property 'instance' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 160         instance: I
framer-motion:build:             ~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:217:9 - error TS2564: Property 'layoutCorrected' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 217         layoutCorrected: Box
framer-motion:build:             ~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:402:13 - error TS2322: Type 'IProjectionNode<unknown> | this' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:   Type 'this' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:     Type 'ProjectionNode' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:       Types of property 'mount' are incompatible.
framer-motion:build:         Type '(instance: I, isLayoutDirty?: boolean) => void' is not assignable to type '(node: unknown, isLayoutDirty?: boolean | undefined) => void'.
framer-motion:build:           Types of parameters 'instance' and 'node' are incompatible.
framer-motion:build:             Type 'unknown' is not assignable to type 'I'.
framer-motion:build:               'I' could be instantiated with an arbitrary type which could be unrelated to 'unknown'.
framer-motion:build:
framer-motion:build: 402             this.root = parent ? parent.root || parent : this
framer-motion:build:                 ~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:448:53 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 448             this.parent && this.parent.children.add(this)
framer-motion:build:                                                         ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:468:45 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 468                         this.nodes!.forEach(finishAnimation)
framer-motion:build:                                                 ~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:474:56 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 474                 this.root.registerSharedNode(layoutId, this)
framer-motion:build:                                                            ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:568:49 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 568                                 finishAnimation(this)
framer-motion:build:                                                     ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:586:35 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 586             stack && stack.remove(this)
framer-motion:build:                                       ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:587:56 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 587             this.parent && this.parent.children.delete(this)
framer-motion:build:                                                            ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:620:46 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is missing the following properties from type 'IProjectionNode<unknown>': id, animationId, children, path, and 61 more.
framer-motion:build:
framer-motion:build: 620             this.nodes && this.nodes.forEach(resetSkewAndRotation)
framer-motion:build:                                                  ~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:652:56 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 652                 cancelTreeOptimisedTransformAnimations(this)
framer-motion:build:                                                            ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:696:37 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 696                 this.nodes!.forEach(clearMeasurements)
framer-motion:build:                                         ~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:701:37 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 701                 this.nodes!.forEach(clearIsLayoutDirty)
framer-motion:build:                                         ~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:709:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 709             this.nodes!.forEach(resetTransformStyle)
framer-motion:build:                                     ~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:715:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 715             this.nodes!.forEach(updateLayout)
framer-motion:build:                                     ~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:721:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 721             this.nodes!.forEach(notifyLayoutUpdate)
framer-motion:build:                                     ~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:749:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 749             this.nodes!.forEach(clearSnapshot)
framer-motion:build:                                     ~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:802:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 802             this.nodes!.forEach(propagateDirtyNodes)
framer-motion:build:                                     ~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:803:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 803             this.nodes!.forEach(resolveTargetDelta)
framer-motion:build:                                     ~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:804:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 804             this.nodes!.forEach(calcProjection)
framer-motion:build:                                     ~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:805:33 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 805             this.nodes!.forEach(cleanDirtyNodes)
framer-motion:build:                                     ~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:1476:9 - error TS2564: Property 'mixTargetDelta' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 1476         mixTargetDelta: (progress: number) => void
framer-motion:build:              ~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:1752:38 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 1752             if (stack) stack.promote(this, preserveFollowOpacity)
framer-motion:build:                                           ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:1764:39 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 1764                 return stack.relegate(this)
framer-motion:build:                                            ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:1952:56 - error TS2345: Argument of type 'IProjectionNode<unknown> | this' is not assignable to parameter of type 'IProjectionNode<unknown>'.
framer-motion:build:   Type 'this' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 1952                         : correct(valuesToRender[key], lead)
framer-motion:build:                                                             ~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:1985:38 - error TS2345: Argument of type '(node: IProjectionNode) => void | undefined' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:   Types of parameters 'node' and 'child' are incompatible.
framer-motion:build:     Type 'WithDepth' is not assignable to type 'IProjectionNode<unknown>'.
framer-motion:build:
framer-motion:build: 1985             this.root.nodes!.forEach((node: IProjectionNode) =>
framer-motion:build:                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build: 1986                 node.currentAnimation?.stop()
framer-motion:build:      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/node/create-projection-node.ts:1988:38 - error TS2345: Argument of type '(node: IProjectionNode<unknown>) => void' is not assignable to parameter of type '(child: WithDepth) => void'.
framer-motion:build:
framer-motion:build: 1988             this.root.nodes!.forEach(clearMeasurements)
framer-motion:build:                                           ~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/projection/styles/scale-box-shadow.ts:6:5 - error TS2322: Type '(latest: string, { treeScale, projectionDelta }: IProjectionNode<unknown>) => string' is not assignable to type 'ScaleCorrector'.
framer-motion:build:   Types of parameters 'latest' and 'latest' are incompatible.
framer-motion:build:     Type 'string | number' is not assignable to type 'string'.
framer-motion:build:       Type 'number' is not assignable to type 'string'.
framer-motion:build:
framer-motion:build: 6     correct: (latest: string, { treeScale, projectionDelta }) => {
framer-motion:build:       ~~~~~~~
framer-motion:build:
framer-motion:build:   src/projection/styles/types.ts:9:5
framer-motion:build:     9     correct: ScaleCorrector
framer-motion:build:           ~~~~~~~
framer-motion:build:     The expected type comes from property 'correct' which is declared here on type 'ScaleCorrectorDefinition'
framer-motion:build:
framer-motion:build: src/render/components/create-factory.ts:30:43 - error TS2345: Argument of type 'string | TagName | ForwardRefExoticComponent<Props>' is not assignable to parameter of type 'string | ComponentType<{ children?: ReactNode; }> | ForwardRefExoticComponent<unknown>'.
framer-motion:build:   Type 'ForwardRefExoticComponent<Props>' is not assignable to type 'string | ComponentType<{ children?: ReactNode; }> | ForwardRefExoticComponent<unknown>'.
framer-motion:build:     Type 'ForwardRefExoticComponent<Props>' is not assignable to type 'ForwardRefExoticComponent<unknown>'.
framer-motion:build:       Types of parameters 'props' and 'props' are incompatible.
framer-motion:build:         Type 'unknown' is not assignable to type 'Props'.
framer-motion:build:           'Props' could be instantiated with an arbitrary type which could be unrelated to 'unknown'.
framer-motion:build:
framer-motion:build: 30         const baseConfig = isSVGComponent(Component)
framer-motion:build:                                              ~~~~~~~~~
framer-motion:build:
framer-motion:build: src/render/dom/DOMKeyframesResolver.ts:22:5 - error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 22     name: string
framer-motion:build:        ~~~~
framer-motion:build:
framer-motion:build: src/render/utils/KeyframesResolver.ts:31:35 - error TS2345: Argument of type '(element: VisualElement<HTMLElement>) => void' is not assignable to parameter of type '(value: VisualElement<any, unknown, {}> | undefined, value2: VisualElement<any, unknown, {}> | undefined, set: Set<VisualElement<any, unknown, {}> | undefined>) => void'.
framer-motion:build:   Types of parameters 'element' and 'value' are incompatible.
framer-motion:build:     Type 'VisualElement<any, unknown, {}> | undefined' is not assignable to type 'VisualElement<HTMLElement, unknown, {}>'.
framer-motion:build:       Type 'undefined' is not assignable to type 'VisualElement<HTMLElement, unknown, {}>'.
framer-motion:build:
framer-motion:build: 31         elementsToMeasure.forEach((element: VisualElement<HTMLElement>) => {
framer-motion:build:                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/render/utils/KeyframesResolver.ts:45:35 - error TS2345: Argument of type '(element: VisualElement<HTMLElement>) => void' is not assignable to parameter of type '(value: VisualElement<any, unknown, {}> | undefined, value2: VisualElement<any, unknown, {}> | undefined, set: Set<VisualElement<any, unknown, {}> | undefined>) => void'.
framer-motion:build:   Types of parameters 'element' and 'value' are incompatible.
framer-motion:build:     Type 'VisualElement<any, unknown, {}> | undefined' is not assignable to type 'VisualElement<HTMLElement, unknown, {}>'.
framer-motion:build:       Type 'undefined' is not assignable to type 'VisualElement<HTMLElement, unknown, {}>'.
framer-motion:build:
framer-motion:build: 45         elementsToMeasure.forEach((element: VisualElement<HTMLElement>) => {
framer-motion:build:                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/render/utils/flat-tree.ts:20:44 - error TS2345: Argument of type '(a: VisualElement, b: VisualElement) => number' is not assignable to parameter of type '(a: WithDepth, b: WithDepth) => number'.
framer-motion:build:   Types of parameters 'a' and 'a' are incompatible.
framer-motion:build:     Type 'WithDepth' is missing the following properties from type 'VisualElement<unknown, unknown, {}>': type, sortInstanceNodePosition, measureInstanceViewportBox, getBaseTargetFromProps, and 58 more.
framer-motion:build:
framer-motion:build: 20         this.isDirty && this.children.sort(compareByDepth)
framer-motion:build:                                               ~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/utils/mix/color.ts:33:29 - error TS2345: Argument of type 'string | Color' is not assignable to parameter of type 'string'.
framer-motion:build:   Type 'RGBA' is not assignable to type 'string'.
framer-motion:build:
framer-motion:build: 33     let model = type!.parse(color)
framer-motion:build:                                ~~~~~
framer-motion:build:
framer-motion:build: src/value/index.ts:95:13 - error TS2564: Property 'updatedAt' has no initializer and is not definitely assigned in the constructor.
framer-motion:build:
framer-motion:build: 95     private updatedAt: number
framer-motion:build:                ~~~~~~~~~
framer-motion:build:
framer-motion:build: src/value/types/complex/index.ts:111:35 - error TS2345: Argument of type '(v: number | string) => string | 0' is not assignable to parameter of type '(value: string | number | Color, index: number, array: (string | number | Color)[]) => string | 0'.
framer-motion:build:   Types of parameters 'v' and 'value' are incompatible.
framer-motion:build:     Type 'string | number | Color' is not assignable to type 'string | number'.
framer-motion:build:       Type 'RGBA' is not assignable to type 'string | number'.
framer-motion:build:
framer-motion:build: 111     return transformer(parsed.map(convertNumbersToZero))
framer-motion:build:                                       ~~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/value/use-spring.ts:49:40 - error TS2769: No overload matches this call.
framer-motion:build:   Overload 1 of 3, '(initialValue: number): MutableRefObject<number>', gave the following error.
framer-motion:build:     Argument of type 'NonNullable<number | MotionValue<number> | MotionValue<string>>' is not assignable to parameter of type 'number'.
framer-motion:build:       Type 'MotionValue<number>' is not assignable to type 'number'.
framer-motion:build:   Overload 2 of 3, '(initialValue: number | null): RefObject<number>', gave the following error.
framer-motion:build:     Argument of type 'NonNullable<number | MotionValue<number> | MotionValue<string>>' is not assignable to parameter of type 'number | null'.
framer-motion:build:       Type 'MotionValue<number>' is not assignable to type 'number'.
framer-motion:build:
framer-motion:build: 49     const latestValue = useRef<number>(value.get())
framer-motion:build:                                           ~~~~~~~~~~~
framer-motion:build:
framer-motion:build:
framer-motion:build: src/value/use-spring.ts:89:13 - error TS2322: Type 'number | MotionValue<number> | MotionValue<string>' is not assignable to type 'number'.
framer-motion:build:   Type 'MotionValue<number>' is not assignable to type 'number'.
framer-motion:build:
framer-motion:build: 89             latestValue.current = v
framer-motion:build:                ~~~~~~~~~~~~~~~~~~~
framer-motion:build:
framer-motion:build: src/value/use-transform.ts:145:15 - error TS2345: Argument of type 'MotionValue<string>[] | MotionValue<number>[] | MotionValue<string | number>[]' is not assignable to parameter of type 'MotionValue<string | number>[]'.
framer-motion:build:   Type 'MotionValue<string>[]' is not assignable to type 'MotionValue<string | number>[]'.
framer-motion:build:     Type 'MotionValue<string>' is not assignable to type 'MotionValue<string | number>'.
framer-motion:build:       Types of property 'passiveEffect' are incompatible.
framer-motion:build:         Type 'PassiveEffect<string> | undefined' is not assignable to type 'PassiveEffect<string | number> | undefined'.
framer-motion:build:           Type 'PassiveEffect<string>' is not assignable to type 'PassiveEffect<string | number>'.
framer-motion:build:             Types of parameters 'v' and 'v' are incompatible.
framer-motion:build:               Type 'string | number' is not assignable to type 'string'.
framer-motion:build:                 Type 'number' is not assignable to type 'string'.
framer-motion:build:
framer-motion:build: 145               input,
framer-motion:build:                   ~~~~~
framer-motion:build:
framer-motion:build:
framer-motion:build: Found 85 errors in 34 files.
framer-motion:build:
framer-motion:build: Errors  Files
framer-motion:build:      1  src/animation/GroupPlaybackControls.ts:32
framer-motion:build:      2  src/animation/animate/index.ts:122
framer-motion:build:      3  src/animation/animators/AcceleratedAnimation.ts:129
framer-motion:build:      1  src/frameloop/frame.ts:10
framer-motion:build:      1  src/frameloop/microtask.ts:4
framer-motion:build:      4  src/gestures/drag/VisualElementDragControls.ts:226
framer-motion:build:      3  src/gestures/pan/PanSession.ts:117
framer-motion:build:      2  src/gestures/pan/index.ts:24
framer-motion:build:      3  src/gestures/press.ts:25
framer-motion:build:      2  src/motion/features/animations.ts:7
framer-motion:build:      2  src/motion/features/drag.ts:9
framer-motion:build:      4  src/motion/features/gestures.ts:9
framer-motion:build:      1  src/motion/features/viewport/index.ts:80
framer-motion:build:      1  src/motion/index.tsx:82
framer-motion:build:      2  src/projection/node/HTMLProjectionNode.ts:14
framer-motion:build:     27  src/projection/node/create-projection-node.ts:160
framer-motion:build:      1  src/projection/styles/scale-box-shadow.ts:6
framer-motion:build:      1  src/render/components/create-factory.ts:30
framer-motion:build:      1  src/render/dom/DOMKeyframesResolver.ts:22
framer-motion:build:      2  src/render/utils/KeyframesResolver.ts:31
framer-motion:build:      1  src/render/utils/flat-tree.ts:20
framer-motion:build:      1  src/utils/mix/color.ts:33
framer-motion:build:      1  src/value/index.ts:95
framer-motion:build:      1  src/value/types/complex/index.ts:111
framer-motion:build:      2  src/value/use-spring.ts:49
framer-motion:build:      1  src/value/use-transform.ts:145
framer-motion:build: ERROR: command finished with error: command (motion/packages/framer-motion) /tmp/xfs-fbf1a63c/yarn run build exited (1)
framer-motion#build: command (motion/packages/framer-motion) /tmp/xfs-fbf1a63c/yarn run build exited (1)     
 Tasks:    1 successful, 2 total
Cached:    0 cached, 2 total
  Time:    21.116s
Failed:    framer-motion#build

 ERROR  run failed: command  exited (1)

@billyjanitsch
Copy link

Is there a reason for disabling skipLibCheck? And how do you deal with other libraries, do they just tend to work?

it feels very much to me like writing tests against external libraries

@mattgperry I understand this perspective, but consider that this flag isn't telling TypeScript to check the source of libraries, just the compiled and published .d.ts typings which are "flattened" to only include consumer-facing exports.

One reason not to enable the flag is that when it's disabled, if TypeScript can't determine a type because of an issue in a dependency's type defs, it silently converts that type to any. This makes it easy for anys to sneak into an application codebase, especially when upgrading dependencies.

I can definitely understand why some enable the flag, but I hope this helps explain why it's off by default and why you might choose to leave it off. Re your other question, other libraries do tend to work with the flag off. This issue is the first I've seen across our codebases' dependencies in a few years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants