rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[api-extractor] types not correctly imported for bundled package

Open MicaiahReid opened this issue 3 years ago • 5 comments
trafficstars

Thanks for the awesome tool!

Summary

I have a project that takes advantage of the API extractor's bundledPackages feature. However, sometimes the exports of the bundled packages are not correctly imported by the generated .d.ts file. Rather than something like import { thing } from "package", API extractor generates import { thing } from "./some/path/to/thing".

Repro steps

I've made a repository for a simplified reproduction: https://github.com/MicaiahReid/api-extractor-repro

Standard questions

Question Answer
@microsoft/api-extractor version? 7.33.2
Operating system? Linux
API Extractor scenario? rollups (.d.ts)
Would you consider contributing a PR? Possibly
TypeScript compiler version? 4.8.2
Node.js version (node -v)? 14.17.0

MicaiahReid avatar Oct 17 '22 18:10 MicaiahReid

In this Zulip thread, @davidmurdoch said that this problem repros for his project when using the latest API Extractor but NOT with v7.20.1.

@zelliott do you think it could be a regression related to #3291 (which was released with 7.21.0)?

octogonz avatar Nov 22 '22 00:11 octogonz

https://github.com/microsoft/rushstack/issues/3291 had to do with tsconfig.json path mappings. Is @MicaiahReid's issue (this issue) related to path mappings? I don't see any path mappings in the minimal repro: https://github.com/MicaiahReid/api-extractor-repro. So it doesn't seem obviously related, but of course it could still be.

zelliott avatar Nov 22 '22 00:11 zelliott

@octogonz I can confirm downgrading to version 7.20.1 fixes the problem for me.

younesmln avatar Apr 14 '23 13:04 younesmln

We are also encountering this issue and can also confirm downgrading to 7.20.1 solved it. For what it's worth we ruled out path mappings as the source of the issue.

SkaffenAmtiskaw avatar Apr 17 '23 13:04 SkaffenAmtiskaw

+1 We are waiting for this to be resolved since 17/04/2023, until then we are stuck with old version of the package.

evgarthub avatar Dec 05 '24 15:12 evgarthub