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

fix: deep-import of index files breaks ts3.9 compilers #81

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Mar 30, 2023

The typesVersions directive applies recursively when the TypeScript compiler searches for the appropriate object to load... When attempting to resolve a directory, it will first rewrite that directory according to the typesVersions directive, and then it will rewrite the index sub-path within there again, resulting in two distinct rewrites happening within the same resolution. This appears to be a TypeScript bug as reported in microsoft/TypeScript#43133.

The work-around is to include a second rewrite candidate that explicitly targets the */index.d.ts sub-path, which removes the need for a rewrite when searching down the index route.

Causes projen/projen#2570


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The `typesVersions` directive applies recursively when the TypeScript
compiler searches for the appropriate object to load... When attempting
to resolve a directory, it will first rewrite that directory according
to the typesVersions directive, and then it will rewrite the `index`
sub-path within there again, resulting in two distinct rewrites
happening within the same resolution. This appears to be a TypeScript
bug as reported in microsoft/TypeScript#43133.

The work-around is to include a second rewrite candidate that explicitly
targets the `*/index.d.ts` sub-path, which makes removes the need for a
rewrite when searching down the `index` route.

Causes projen/projen#2570
@RomainMuller RomainMuller changed the title fix: deepo-import of index files breaks ts3.9 compilers fix: deep-import of index files breaks ts3.9 compilers Mar 30, 2023
@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Mar 30, 2023
Merged via the queue into main with commit fc559a8 Mar 30, 2023
@aws-cdk-automation aws-cdk-automation deleted the rmuller/fix-dep-import branch March 30, 2023 12:18
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 this pull request may close these issues.

3 participants