Skip to content

[api-extractor] Canonical names are getting suffixed with _2 unnecessarily. #3581

Open

Description

@TheDrone7

Summary

When running the API extractor, my interface StorageManager and interface ImageData get suffixed with a _2 in their canonical names, however, their references remain the right name.

The source code is available at https://github.com/TheDrone7/shieldbow

The source code where I am getting the issue is available in the weird-docs branch - https://github.com/TheDrone7/shieldbow/tree/weird-docs

Even after bumping to the new version, it worked right a few times but suddenly started happening a couple of hours before this issue was created.

Repro steps

Fork the repo linked above.

Simply just run the API extractor and when I went to check the extracted json file, it had _2, can be confirmed by running the npm docs:gen script and then seeing the generated docs by running docs:dev.

Standard questions

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

Question Answer
@microsoft/api-extractor version? 7.29.0
Operating system? Arch Linux (Kernel 5.18.16)
API Extractor scenario? docs (.api.json)
Would you consider contributing a PR? Yes
TypeScript compiler version? 4.7.4
Node.js version (node -v)? 16.16.0

Activity

  1. changed the title [-][api-extractor] [/-] [+][api-extractor] Canonical names are getting suffixed with `_2` unnecessarily.[/+] on Aug 9, 2022
  2. zelliott commented on Aug 13, 2022

    @zelliott
    Contributor

    I'm unfortunately having a tough time repro-ing this. Here's what I did:

    1. Cloned the repo
    2. Checked out the weird-docs branch
    3. Ran npm install
    4. Ran npm run docs:gen

    Only the docs/api/StatPerks.md file seems to be changing for me. No other changes. I've tried running npm run docs:gen about 10 separate times, and still no repro.

    • OS: macOS Monterey 12.5
    • Node.js version: v16.14.1

    The code that suffixes names to make them unique is at

    private _makeUniqueNames(): void {

    That would be the first place to look for any indeterminism.

  3. TheDrone7 commented on Aug 24, 2022

    @TheDrone7
    Author

    Since I was using a custom documents generator, I simply added a bypass for this right there as I could not figure this one out here but would definitely appreciate someone else taking a go at this cuz my document generator lookin a little sus rn.

  4. moved this from Needs triage to AE/AD in Bug Triageon Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions