-
Notifications
You must be signed in to change notification settings - Fork 618
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] Unable to follow symbol for "const" (part 2) #5077
Comments
Slight edit: Adding |
For posterity, I've found another workaround: don't export the /**
* Mixin added to function call options to indicate whether it should
* throw, or silently swallow the error.
*/
export interface ThrowOnError {
throwOnError?: boolean;
}
// This is distinct from NO_THROW below due to a bug in api-extractor:
// https://github.com/microsoft/rushstack/issues/5077
const DO_NOT_THROW = Object.freeze({
throwOnError: false,
} as const satisfies ThrowOnError);
/**
* Value of {@link ThrowOnError} which will avoid throwing.
*/
export const NO_THROW = DO_NOT_THROW; At a doc level, this still produces the correct NO_THROW: Readonly<{
readonly throwOnError: false;
}> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
This produces the same error as #3875 but has a very different repro.
Exporting and documenting a value
as const
causes theUnable to follow symbol for "const"
error.Repro steps
Type defs:
Note the last line. I have it
as const
and I don't have it typed asThrowOnError
so I don't throw away thefalse
value, but I also havesatisfies
so I can ensure I don't mistype it.Note that the error still occurs if you remove
satisfies
. I'm leaving it here for context.Workarounds:
as const
Add@internal
to the tsdoc.Expected result: No error
Actual result: Error:
Unable to follow symbol for "const"
Details
Above.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
version?7.49.1
Extractor.invoke
5.7.3
node -v
)?v20.17.0
The text was updated successfully, but these errors were encountered: