Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getReferencedSourceFiles() doesn’t resolve dynamic imports #1435

Closed
lo1tuma opened this issue Aug 7, 2023 · 0 comments · Fixed by #1436
Closed

getReferencedSourceFiles() doesn’t resolve dynamic imports #1435

lo1tuma opened this issue Aug 7, 2023 · 0 comments · Fixed by #1436

Comments

@lo1tuma
Copy link
Contributor

lo1tuma commented Aug 7, 2023

I want to analyze the dependency tree of typescript files using getReferencedSourceFiles(). I’ve noticed that it doesn’t work for file with dynamic imports, as for example:

declare const foo: import("./foo").Foo

When enabling logging, I get the following warning: Unknown import string literal parent: LiteralType.

I get a valid result for the dynamic import when calling getImportStringLiterals(). So I assume that the ImportType Node needs to be handled somehow in getSourceFileForLiteral().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant