formkit / auto-animate

A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application.

Home Page:https://auto-animate.formkit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not find a declaration file for module '@formkit/auto-animate'. in Yarn berry

Dann1y opened this issue · comments

import { getTransitionSizes, AutoAnimationPlugin } from "@formkit/auto-animate";

red line -> "@formkit/auto-animate"

// error

'{path}/.yarn/cache/@formkit-auto-animate-npm-0.7.0-459537d1b4-c714bf9609.zip/node_modules/@formkit/auto-animate/index.mjs' implicitly has an 'any' type.

  There are types at '{path}/.yarn/cache/@formkit-auto-animate-npm-0.7.0-459537d1b4-c714bf9609.zip/node_modules/@formkit/auto-animate/index.d.ts',
but this result could not be resolved when respecting package.json

"exports". The '@formkit/auto-animate' library may need to update its package.json or typings.ts(7016)

{path} is my local directory path.
My environment

  • MacOS applie silicon M1 pro
  • yarn workspace (monorepo)
  • yarn berry (pnp mode)

I'm having a problem with the type, but I'm not sure, so please check this problem.
Please let me know if I'm using it the wrong way

I've fixed this in #151.

If you need a temporary solution, you can use patch-package and this patch:

diff --git a/node_modules/@formkit/auto-animate/package.json b/node_modules/@formkit/auto-animate/package.json
index e224bd5..d961409 100644
--- a/node_modules/@formkit/auto-animate/package.json
+++ b/node_modules/@formkit/auto-animate/package.json
@@ -52,6 +52,7 @@
     },
     ".": {
       "import": "./index.mjs",
+      "types": "./index.d.ts",
       "default": "./index.mjs"
     }
   }

@bengry
Thanks for your fix 🙏🏻
I will check after merge #151 PR!