azure-sdk-for-js: Cannot find name 'URL'

  • azure/keyvault-secrets:
  • ^4.0.4:
  • linux:
  • nodejs
    • 10:
  • typescript
    • ^3.9.7:

Describe the bug

node_modules/@azure/keyvault-secrets/types/keyvault-secrets.d.ts:477:22 - error TS2304: Cannot find name 'URL'.

477     readonly keyId?: URL;

To Reproduce Steps to reproduce the behavior:

  1. build the project using typescript

Expected behavior should build without any error

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@sadasant I will try by adding the dom in the tsconfig file as a temporary solution until this bug is fixed.

And, I appreciate your help. Thank you.

@krisalay Hi again! Thank you for your reply.

I wanted to get a more concrete path for reproduction, but right out of your screenshot I have a concrete idea of what’s going on. I appreciate your reply!

Key Vault Secrets currently has a bug with this keyId: URL property that you’re spotting.

While we reach to an agreement about the solution, I believe the following will help you:

Add "lib": ["dom"] to your tsconfig.json, or simply add dom to an existing array in the lib property, as how we’re currently doing here: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-secrets/tsconfig.json

That should fix it for you. Please help us by trying this and reporting back. Thank you for your time!