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:
- build the project using typescript
Expected behavior should build without any error
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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 adddom
to an existing array in thelib
property, as how we’re currently doing here: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-secrets/tsconfig.jsonThat should fix it for you. Please help us by trying this and reporting back. Thank you for your time!