-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I am writing a TypeScript node module, and getting the following error when using @randomorg/core:
src/util/random.ts:1:31 - error TS7016: Could not find a declaration file for module '@randomorg/core'. '/home/lsanderson/src/minesweeper/node_modules/@randomorg/core/lib/esm/index.js' implicitly has an 'any' type.
There are types at '/home/lsanderson/src/minesweeper/node_modules/@randomorg/core/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@randomorg/core' library may need to update its package.json or typings.
1 import {RandomOrgClient} from '@randomorg/core';
~~~~~~~~~~~~~~~~~
Found 1 error in src/util/random.ts:1
I can fix this locally by explicitly adding index.d.ts into your package.json, like so:
{
...
"types": "./types/index.d.ts",
"typings": "./types/index.d.ts",
"exports": {
"require": "./lib/index.js",
"import": "./lib/esm/index.js",
"types": "./types/index.d.ts"
},
...
}If you agree this is a good solution, can you please add it? Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels