Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export { KeyPairType } from 'virgil-crypto/dist/node.es.js' is a ANY type #174

Open
thecannabisapp opened this issue Mar 25, 2024 · 2 comments

Comments

@thecannabisapp
Copy link

Describe the bug
TSC error when trying to compile for deployment using node v18.18.2.
node_modules/@virgilsecurity/e3kit-node/dist/types/src/index.d.ts:2:29 - error TS7016: Could not find a declaration file for module 'virgil-crypto/dist/node.es.js'.

Package dependencies

    "@virgilsecurity/e3kit-node": "^3.0.5",
    "virgil-crypto": "^5.1.1",
    "virgil-sdk": "^6.2.0",
    "typescript": "^5.3.3"

Looks like the KeyPairType exported has a any type and is making TSC complain.

Expected behavior
Expect KeyPairType export to have type.

Screenshots
Screenshot 2024-03-25 at 17 27 46

> tsc

node_modules/@virgilsecurity/e3kit-node/dist/types/src/index.d.ts:2:29 - error TS7016: Could not find a declaration file for module 'virgil-crypto/dist/node.es.js'. '/Users/admin/app/functions/node_modules/virgil-crypto/dist/node.es.js' implicitly has an 'any' type.
  If the 'virgil-crypto' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'virgil-crypto/dist/node.es.js';`

2 export { KeyPairType } from 'virgil-crypto/dist/node.es.js';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@virgilsecurity/e3kit-node/dist/types/src/index.d.ts:2
@rstp-god
Copy link
Collaborator

@chinesehemp Hello! Sorry for being late, you do not need to import KyPairType from /dist/node.es.js
This will work, because .es files working not like modules!
import { KeyPairType } from 'virgil-crypto';

@thecannabisapp
Copy link
Author

@chinesehemp Hello! Sorry for being late, you do not need to import KyPairType from /dist/node.es.js This will work, because .es files working not like modules! import { KeyPairType } from 'virgil-crypto';

Hi @rstp-god thanks for getting back to me. I'm not trying to import KeyPairType from virgil-crypto. Maybe I didn't word it correctly. The issue is Typescript compiler is warning me of an error and I traced it back to the source where the type had the any value.

> tsc

node_modules/@virgilsecurity/e3kit-node/dist/types/src/index.d.ts:2:29 - error TS7016: Could not find a declaration file for module 'virgil-crypto/dist/node.es.js'. '/Users/admin/app/functions/node_modules/virgil-crypto/dist/node.es.js' implicitly has an 'any' type.
  If the 'virgil-crypto' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'virgil-crypto/dist/node.es.js';`

2 export { KeyPairType } from 'virgil-crypto/dist/node.es.js';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@virgilsecurity/e3kit-node/dist/types/src/index.d.ts:2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants