Skip to content

[api-extractor] SyntaxKind.SourceFile not supported by API Extractor #5671

@perezgarciam

Description

@perezgarciam

Summary

Running into following the error when running api-extractor

ERROR: Internal Error: The ""../api-extractor-repro/lib/abc"" symbol has a ts.SyntaxKind.SourceFile declaration which is not (yet?) supported by API Extractor

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

Repro steps

Here's a minimal repro https://github.com/perezgarciam/api-extractor-repro

gh repo clone perezgarciam/api-extractor-repro
cd api-extractor-repro
npm install
npm start

Details

Seems that importing the type throws the error as updating the code to the snippet below fixes the problem

const abcImport = import('./abc');

/**
 * Asynchronously loads function that returns a number
 */
export const fnAsync: Promise<typeof import('./abc').fn> = abcImport.then((module) => module.fn);

Standard questions

Question Answer
@microsoft/api-extractor version? 7.57.3
Operating system? Mac
API Extractor scenario? Reporting
Would you consider contributing a PR? With guidance
TypeScript compiler version? 5.9.3
Node.js version (node -v)? v24.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions