-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 & build issue: Internal Error: The "MenuTrigger" symbol has a ts.SyntaxKind.Identifier declaration which is not (yet?) supported by API Extractor #19360
Comments
Thanks for digging into this! Should we open an API Extractor issue as well? |
Because this issue has not had activity for over 180 days, we're automatically closing it for house-keeping purposes. Still require assistance? Please, create a new issue with up-to date details. |
I inadvertently removed this shim in #22144 and the build passed without issue. Is it possible this shim is no longer needed? |
you didn't remove it. it's about local build execution which works differently than on CI because we use path aliases |
Because this issue has not had activity for over 180 days, we're automatically closing it for house-keeping purposes. Still require assistance? Please, create a new issue with up-to date details. |
Describe the issue:
While migrating
react-components
suite to new DX (#19040), an interesting error appeared both on local and CI:Actual behavior:
Expected behavior:
api-extractor
task should succeedTroubleshooting
I was able to find 2 similar kind of issue on api-extractor repo:
Although none of those were exact match to this issue, so I dig deeper.
After reverse engineering api-extractor source I was able to find the issue:
The issue surfaced only now, because
react-components
re-exports multiple packages from N packages, which is not happening per narrowed package scope.To better understand lets check following visualization of how
build
task is being executed (in simplified manner):the build was failing while running
api-extractor
task, with aforementioned errorError: Internal Error: The "MenuTrigger" symbol has a ts.SyntaxKind.Identifier declaration which is not (yet?) supported by API Extractor
...Why is that happening ?
IF take a look at
MenuTrigger
implementationThere is nothing suspicious right? If we remove
MenuTrigger.displayName = 'MenuTrigger';
the error will go away. Most of other component is usingforwardRef
so probably that's where the problem lies ?NOPE
The problem is
ts.SyntaxKind.Identifier
which means, parser has issues withconst
. Which brings us to -> wait why is api-extractor parsing implementation files instead of declaration types ?After many hours :D , I finally found the culprit:
How to fix this ?
just-scripts
scope:ts
task execution ( which is aware if package is using new DX thus turns off path aliases )local:build
scope:api-extractor.local.json
overrides forreact-components
initially, later on for all vNext packagesThe text was updated successfully, but these errors were encountered: