Closed ayame113 closed 11 months ago
I noticed that imports of the form import("module").Foo<import("module").Bar> do not resolve dependencies.
import("module").Foo<import("module").Bar>
This issue can be reproduced as follows:
// child_a.ts export type Foo<T> = T;
// child_b.ts export type Bar = string;
// parent.ts type A = import("./child_a.ts").Foo<import("./child_b.ts").Bar>; // ^^^ I expected `string` but got `any`
Type A in parent.ts should be string, but is of type any because the dependencies are not resolved.
A
parent.ts
string
any
Additionally, I looked at the output of deno info and it should contain child_b.ts, but it does not.
deno info
child_b.ts
> deno info parent.ts local: C:\Users\ayame\work\deno\test\parent.ts type: TypeScript dependencies: 1 unique size: 90B file:///C:/Users/ayame/work/deno/test/parent.ts (65B) └── file:///C:/Users/ayame/work/deno/test/child_a.ts (25B)
I found this at https://esm.sh/v102/@octokit/rest@19.0.5/dist-types/index.d.ts . Potentially, many type checks in esm.sh may be disabled.
version: Deno 1.29.1
It seems that this issue is still not resolved in v1.35.0. I wonder if it's a swc_ecma_dep_graph bug.
I noticed that imports of the form
import("module").Foo<import("module").Bar>
do not resolve dependencies.This issue can be reproduced as follows:
Type
A
inparent.ts
should bestring
, but is of typeany
because the dependencies are not resolved.Additionally, I looked at the output of
deno info
and it should containchild_b.ts
, but it does not.I found this at https://esm.sh/v102/@octokit/rest@19.0.5/dist-types/index.d.ts . Potentially, many type checks in esm.sh may be disabled.
version: Deno 1.29.1