motion icon indicating copy to clipboard operation
motion copied to clipboard

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

Open polarove opened this issue 1 year ago • 5 comments

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 avatar Nov 21 '23 07:11 polarove

package manager: yarn

polarove avatar Nov 21 '23 07:11 polarove

Still present.

Could not find a declaration file for module '@vueuse/motion'. 'node_modules/.pnpm/@[email protected][email protected]/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.

MatthewAry avatar Dec 04 '23 15:12 MatthewAry

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"
    }
  },

AntonyZ89 avatar Dec 17 '23 15:12 AntonyZ89

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

MaxTechnics avatar Dec 29 '23 13:12 MaxTechnics

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

Tristan971 avatar Feb 05 '24 11:02 Tristan971