Popmotion / popmotion

Simple animation libraries for delightful user interfaces
https://popmotion.io
20k stars 663 forks source link

Cannot find module '../../../framesync/lib'. #865

Open daniele-orlando opened 4 years ago

daniele-orlando commented 4 years ago

Add the package name to bug title

popmotion: 9.0.0-beta-8 framer-motion: 1.8.4

Describe the bug

node_modules/framer-motion/node_modules/popmotion/lib/reactions/value.d.ts:26:41 - error TS2307: Cannot find module '../../../framesync/lib'.

scheduleVelocityCheck: () => import("../../../framesync/lib").Process;

You can't assume that "framesync" is three levels up. npm dedupe and npm install deduping strategy move framesync up.

How to reproduce

Steps to reproduce the behavior:

  1. Create a react app
  2. install framer-motion
  3. npm dedupe
  4. Compile with typescript the react app
bmcmahen commented 4 years ago

Any workarounds for this?

IgnusG commented 4 years ago

I've just stumbled upon this issue with popmotion installed directly. Is there a way around this?

IgnusG commented 4 years ago

Installing popmotion 9.0.0-beta-8 along with framer-motion 2.0.0-beta.72 fixed the error for me.

adriencohen commented 4 years ago

Fixed with this .patch

diff --git a/lib/reactions/value.d.ts b/lib/reactions/value.d.ts
index b3075a8..1b80341 100644
--- a/lib/reactions/value.d.ts
+++ b/lib/reactions/value.d.ts
@@ -1,4 +1,4 @@
-import { FrameData } from 'framesync';
+import { FrameData, Process } from 'framesync';
 import { ObserverCandidate, ObserverProps, Update } from '../observer/types';
 import { BaseMulticast } from './';
 import { HotSubscription } from './types';
@@ -23,7 +23,7 @@ export declare class ValueReaction extends BaseMulticast<ValueReaction> {
     get(): Value;
     getVelocity(): any;
     update(v: Value): void;
-    scheduleVelocityCheck: () => import("../../../framesync/lib").Process;
+    scheduleVelocityCheck: () => Process;
     velocityCheck: ({ timestamp }: FrameData) => void;
     subscribe(observerCandidate: ObserverCandidate): HotSubscription;
     private getSingleVelocity;
daniele-orlando commented 4 years ago

Great