vueuse / motion

🤹 Vue Composables putting your components in motion
https://motion.vueuse.org
MIT License
2.13k stars 75 forks source link

[Bug] Could not find a declaration file for module '@vueuse/motion'. #160

Closed polarove closed 4 months ago

polarove commented 7 months ago

What happened? Could not find a declaration file for module '@vueuse/motion'.

Error message

  1. 'c:/projects/project-name/node_modules/@vueuse/motion/dist/index.mjs' implicitly has an 'any' type.
  2. There are types at 'c:/projects/project-name/node_modules/@vueuse/motion/dist/index.d.ts',
  3. but this result could not be resolved when respecting package.json "exports".

Tips The '@vueuse/motion' library may need to update its package.json or typings.

polarove commented 7 months ago

package manager: yarn

MatthewAry commented 7 months ago

Still present.

Could not find a declaration file for module '@vueuse/motion'. 'node_modules/.pnpm/@vueuse+motion@2.0.0_vue@3.3.10/node_modules/@vueuse/motion/dist/index.mjs' implicitly has an 'any' type.
  There are types at 'node_modules/@vueuse/motion/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@vueuse/motion' library may need to update its package.json or typings.
AntonyZ89 commented 6 months ago

They already fixed this, but didn't create a new tag. The error will persist until a new version tag is created. A workaround is add "type" on exports inside your node_modules:

  "exports": {
    ".": {
+      "types": "./dist/index.d.ts",
      "require": "./dist/index.cjs",
      "import": "./dist/index.mjs"
    },
    "./nuxt": {
+      "types": "./dist/nuxt.d.ts",
      "require": "./dist/nuxt.cjs",
      "import": "./dist/nuxt.mjs"
    }
  },
MaxTechnics commented 6 months ago

Indeed, a 2.0.1 patch should be made and released. However you should be able to use the master branch in npm using npm install "https://github.com/vueuse/motion.git#main" --save

Tristan971 commented 4 months ago

Is there something blocking a 2.0.1 patch release here? Can we help?