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

[KeyVault] Updated path of the types to point to the correct directory #4716

Closed

Conversation

michaelmcmillan
Copy link

Problem

When installing the keyvault-secrets package by typing yarn add @azure/keyvault-secrets and then trying to use it like this:

import { DefaultAzureCredential } from "@azure/identity";
import { SecretsClient } from "@azure/keyvault-secrets";

the tsc (TypeScript compiler) raises the following error:

Could not find a declaration file for module '@azure/keyvault-secrets'. 'node_modules/@azure/keyvault-secrets/dist/index.js' implicitly has an 'any'     type. Try `npm install @types/azure__keyvault-secrets` if it exists or add a new declaration (.d.ts) file containing `declare module '@azure/keyvault-secrets';`

What I think is causing this

This is not the correct path to the types: 8e3c933#diff-9cb805b9c2b8f9e19a3d3937d6a28ce2R51. Here is the tree of the types/src directory:

node_modules/@azure/keyvault-secrets/types/src
├── core
├── index.d.ts
├── index.d.ts.map
├── secretsModels.d.ts
└── secretsModels.d.ts.map

Suggested fix

Change the types parameter in package.json to point to the types/src/ so that it implicitly uses types/src/index.d.ts.

@michaelmcmillan michaelmcmillan changed the title Updated path of the types to point to the correct directory [KeyVault] Updated path of the types to point to the correct directory Aug 8, 2019
@sophiajt
Copy link
Contributor

sophiajt commented Aug 8, 2019

Thanks for raising this. The issue looks like the .d.ts file we're creating isn't getting properly put into the package. It should be getting built by API Extractor using the .d.ts files tsc produces. I'll look into this a bit further and see if I can work out why it's not running properly.

@sophiajt
Copy link
Contributor

sophiajt commented Aug 8, 2019

Filed #4720, which I think is the core issue here.

Thanks again for the report.

@michaelmcmillan
Copy link
Author

michaelmcmillan commented Aug 8, 2019 via email

@ramya-rao-a
Copy link
Contributor

Thanks for bringing this to our attention @michaelmcmillan!

Closing this PR as we have now shipped an update for the keyvault-secrets library with the same fix from the PR #4722

@sadasant
Copy link
Contributor

@michaelmcmillan Michael, being honest, I missed your PR. I think I was laser focused on the tasks I had. We do appreciate the time you put here. Please continue with your contributions!

Also, have a great weekend!

@michaelmcmillan
Copy link
Author

No worries, thanks for responding so quickly!

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

Successfully merging this pull request may close these issues.

4 participants