@azure/core-tracing@1.0.1: Type alias 'Resolved' circularly references itself.
See original GitHub issue- @azure/core-tracing:
- 1.0.1:
- nodejs
- v14.19.1:
- typescript
- 3.9.10:
Describe the bug
tsc
node_modules/@azure/core-rest-pipeline/node_modules/@azure/core-tracing/types/core-tracing.d.ts:81:21 - error TS2456: Type alias 'Resolved' circularly references itself.
81 export declare type Resolved<T> = T extends {
~~~~~~~~
node_modules/@azure/core-rest-pipeline/node_modules/@azure/core-tracing/types/core-tracing.d.ts:83:41 - error TS2315: Type 'Resolved' is not generic.
83 } ? F extends (value: infer V) => any ? Resolved<V> : never : T;
~~~~~~~~~~~
node_modules/@azure/core-rest-pipeline/node_modules/@azure/core-tracing/types/core-tracing.d.ts:131:212 - error TS2315: Type 'Resolved' is not generic.
131 }, Callback extends (updatedOptions: Options, span: Omit<TracingSpan, "end">) => ReturnType<Callback>>(name: string, operationOptions: Options
To Reproduce pacakge.json
{
"name": "repro",
"version": "1.0.0",
"description": "",
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@azure/core-rest-pipeline": "^1.8.1",
"typescript": "^3.9.10"
}
}
index.ts
import { Resolved } from "./node_modules/@azure/core-tracing"
let r: Resolved<string>;
tsconfigs.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": false
}
}
- npm install
- npm run build
Expected behavior Project should build successfully.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Type alias circularly references itself · Issue #14174 - GitHub
I'm trying to create a type that circularly references itself, but in a way that it makes sense - or at least it...
Read more >Type alias circularly references itself - Stack Overflow
Per the documentation, a type alias can refer to itself in a property, but not anywhere else on the right side of the...
Read more >Resolved type alias - Microsoft Learn
A narrower version of TypeScript 4.5's Awaited type which Recursively unwraps the "awaited type", emulating the behavior of await.
Read more >Error TS2456: Type alias 'Awaited' circularly references itself
I have an error when adding angular instansearch module: Error: ../../../node_modules/instantsearch.js/es/types/utils.d.ts:12:21 - error ...
Read more >TypeScript interface vs. type - pawelgrzybek.com
Equivalent with type alias results with Type alias circularly references itself compiler error. Recursively chained type aliases result in ...
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
Hi @nmarinel and @hund030 - It looks like our
Resolved
type uses features that are available in TypeScript >= 4.1, specifically https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#recursive-conditional-typesWe are looking into options for downleveling the types to support TypeScript 3.x but in the interim if you can use TypeScript 4.1 or later this error should be resolved.
I just workaround this issue by adding
in my tsconfig.json