Skip to content

[api-extractor] 7.30.0 causes tryGetEntityForIdentifier() called for an identifier that was not analyzed #3620

@ocavue

Description

@ocavue

Summary

After updating api-extractor from v7.29.5 to v7.30.0, api-extractor run will print the following error:

ERROR: Internal Error: tryGetEntityForIdentifier() called for an identifier that was not analyzed

Repro steps

I've created a mini repo: https://github.com/issueset/api-extractor-7-30-0-issue

$ git clone https://github.com/issueset/api-extractor-7-30-0-issue
$ cd api-extractor-7-30-0-issue
$ pnpm install 
$ pnpm build

> [email protected] build /private/tmp/api-extractor-7-30-0-issue
> tsc -b tsconfig.json && api-extractor run --local


api-extractor 7.30.0  - https://api-extractor.com/

Using configuration from ./api-extractor.json
Analysis will use the bundled TypeScript version 4.7.4

ERROR: Internal Error: tryGetEntityForIdentifier() called for an identifier that was not analyzed
You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
 ELIFECYCLE  Command failed with exit code 1.

Version v7.29.5 is fine.

$ git reset --hard v7.29.5
$ pnpm install
$ pnpm build

> [email protected] build /private/tmp/api-extractor-7-30-0-issue
> tsc -b tsconfig.json && api-extractor run --local


api-extractor 7.29.5  - https://api-extractor.com/

Using configuration from ./api-extractor.json
Analysis will use the bundled TypeScript version 4.7.4
Warning: The API report file was missing, so a new file was created. Please add this file to Git:
/private/tmp/api-extractor-7-30-0-issue/etc/api-extractor-issue.api.md

API Extractor completed successfully

Expected result: No error

Actual result: Internal Error

Details

There is a global namespace in the source code, which could cause this bug.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.30.0
Operating system? mac
API Extractor scenario? docs
Would you consider contributing a PR? No
TypeScript compiler version? 4.7.4
Node.js version (node -v)? v16.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as intendedrepro confirmedThe issue comments included repro instructions, and the maintainers reproduced the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions