question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find name 'URL'

See original GitHub issue
  • 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

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
krisalaycommented, Aug 21, 2020

@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.

2reactions
sadasantcommented, Aug 21, 2020

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find name 'URL' error in TypeScript | bobbyhadz
To solve the "Cannot find name URL" error, make sure to add the DOM string to the lib array in your tsconfig.json file...
Read more >
[got] error TS2304: Cannot find name 'URL' #19799 - GitHub
URL is available in the dom typings provided by TypeScript. It's a global there so it doesn't need to be explicitly imported.
Read more >
TypeScript getting error TS2304: cannot find name ' require'
I am getting the error "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page. I have...
Read more >
open-telemetry/opentelemetry-node - Gitter
node_modules/@opentelemetry/plugin-http/build/src/http.d.ts:44:95 - error TS2304: Cannot find name 'URL'.
Read more >
TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found