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

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

Closed
ocavue opened this issue Sep 10, 2022 · 5 comments
Labels
bug Something isn't working as intended repro confirmed The issue comments included repro instructions, and the maintainers reproduced the problem

Comments

@ocavue
Copy link

ocavue commented Sep 10, 2022

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
@sranka
Copy link

sranka commented Sep 12, 2022

The same error happens in influxdata/influxdb-client-js#565

$ yarn workspaces run apidoc:extract

> @influxdata/influxdb-client
$ api-extractor run
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
*** The target project appears to use TypeScript 4.8.2 which is newer than the bundled compiler engine; consider upgrading API Extractor.

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.
error Command failed with exit code 1.

@octogonz octogonz added bug Something isn't working as intended repro confirmed The issue comments included repro instructions, and the maintainers reproduced the problem labels Sep 13, 2022
@octogonz
Copy link
Collaborator

octogonz commented Sep 13, 2022

@zelliott could this be a regression from PR #3584 ?

@zelliott
Copy link
Contributor

Likely, yes. I'll look into it tomorrow. @ocavue - if you're interested in looking into this before then, see the conversation at #3584 (comment) and the associated highlighted code.

@zelliott
Copy link
Contributor

We recently released API Extractor v7.31.0. I tried to repro this issue with v7.31.0, and was unable to do so. I think this could be fixed now - @ocavue can you confirm?

@ocavue
Copy link
Author

ocavue commented Sep 20, 2022

@zelliott It's fixed on my side too. Thank you for your help!

@ocavue ocavue closed this as completed Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended repro confirmed The issue comments included repro instructions, and the maintainers reproduced the problem
Projects
None yet
Development

No branches or pull requests

4 participants