Cannot find name 'DedicatedGatewayRequestOptions'
See original GitHub issue- Package Name: @azure/cosmos
- Package Version: 3.16.0
- Operating system: Windows
- [v] nodejs
- version: 16.15.0
- [v] typescript
- version: 4.0.0
- [v] Functions
- version: 3.0.0
Describe the bug
I am trying to use @azure/cosmos inside an Azure Function written in typescript.
When I try to npm run build
, the build fails with : node_modules/@azure/cosmos/dist/types/latest/cosmos.d.ts:1365:78 - error TS2304: Cannot find name 'DedicatedGatewayRequestOptions'.
at the stage of tsc
.
To Reproduce Steps to reproduce the behavior:
- Create an azure function in typescript
- NPM Install @azure/cosmos 3.16.0
- Try to run locally the function
Expected behavior Be able to run the function without tsc bug.
Additional context I try to run the function locally, using Visual Studio Code, but I guess it will happen on terminal or in remote too.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:8 (6 by maintainers)
Top Results From Across the Web
DedicatedGatewayRequestOptio...
Gets the staleness value associated with the request in the Azure CosmosDB service. DedicatedGatewayRequestOptions, setMaxIntegratedCacheStaleness(Duration ...
Read more >cannot find name with typescript and deno
I have the error : error: TS2304 [ERROR]: Cannot find name 'mapboxgl'. mapboxgl.accessToken ...
Read more >CosmosItemRequestOptions (Azure SDK for Java ... - NET
Gets the Dedicated Gateway Request Options. String. getIfMatchETag(). Gets the If-Match (ETag) associated with the request in the Azure Cosmos DB service.
Read more >@azure/cosmos | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >Error TS2304 Cannot find name 'WebGLObject' - Questions
Hey there, I need help with my unity setup. I've got a new pc, so it's the second time that I installed babylon.js...
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 Free
Top 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
Yeah, I agree this one is a bit odd due to the fact a stable interface depends on it. I think this will be a good case study as we figure out the guidelines for beta APIs.
@raskyer As a quick workaround until we can get a fix released, you can enable the
skipLibCheck
option in your tsconfig file. This option will cause the typescript compiler to skip checking dependencies’ .d.ts files for completeness. Your code will still be checked against the cosmos.d.ts types, but the cosmos.d.ts file itself will not be checked (effectively, it’ll be like the missing interface is declared empty).Another option, if you want to keep lib checking enabled, is to declare the missing type in your project (such as in the index or entry-point file):
This will create an ambient definition for the interface in your project that will safely merge with the real definition once a fix is released (at which point you can just remove it).
@joheredi @xirzec for FYI. Not sure I agree with using
betaTrimmedFilePath
for a stable library. We should do that if we are going to release a 3.16.0-beta, but in this case the interface cannot be marked beta since it is a dependency of a stable interface (RequestOptions
). The only logical case for a stable interface to depend on a beta interface is if the package is itself releasing a new minor beta. The reason we missed this is probably because we test withskipLibCheck
disabled ourselves.