Skip to content

newer typescript version don't find typings #3

@YPetremann

Description

@YPetremann

Error:
Could not find a declaration file for module 'threejs-math'. './node_modules/threejs-math/build/threejs-math.module.js' implicitly has an 'any' type.
There are types at './node_modules/threejs-math/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'threejs-math' library may need to update its package.json or typings.

Causes:

Newer typescript want a exports["."].types

Solution:
in package json

{
  ...
  "typings": "types/index.d.ts",
  "exports": {
    ".": {
      "import": "./build/threejs-math.module.js",
      "require": "./build/threejs-math.cjs",
      "types": "./types/index.d.ts"
    }
  },
  ...
}

solved by #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions