rushstack
rushstack copied to clipboard
[api-extractor] types not correctly imported for bundled package
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 |
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)?
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.
@octogonz I can confirm downgrading to version 7.20.1 fixes the problem for me.
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.
+1 We are waiting for this to be resolved since 17/04/2023, until then we are stuck with old version of the package.