File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -264,9 +264,10 @@ export class ExportAnalyzer {
264
264
moduleSpecifier
265
265
) ;
266
266
267
- // This is known to happen for ambient modules. For now, just treat all ambient modules as
268
- // external. This is tracked by https://github.com/microsoft/rushstack/issues/3335.
269
267
if ( resolvedModule === undefined ) {
268
+ // The TS compiler API `getResolvedModule` cannot resolve ambient modules. Thus, to match API Extractor's
269
+ // previous behavior, simply treat all ambient modules as external. This bug is tracked by
270
+ // https://github.com/microsoft/rushstack/issues/3335.
270
271
return true ;
271
272
}
272
273
@@ -868,10 +869,11 @@ export class ExportAnalyzer {
868
869
) ;
869
870
870
871
if ( resolvedModule === undefined ) {
871
- // This should not happen, since getResolvedModule() specifically looks up names that the compiler
872
- // found in export declarations for this source file
872
+ // Encountered in https://github.com/microsoft/rushstack/issues/1914.
873
873
//
874
- // Encountered in https://github.com/microsoft/rushstack/issues/1914
874
+ // It's also possible for this to occur with ambient modules. However, in practice this doesn't happen
875
+ // as API Extractor treats all ambient modules as external per the logic in `_isExternalModulePath`, and
876
+ // thus this code path is never reached for ambient modules.
875
877
throw new InternalError (
876
878
`getResolvedModule() could not resolve module name ${ JSON . stringify ( moduleSpecifier ) } \n` +
877
879
SourceFileLocationFormatter . formatDeclaration ( importOrExportDeclaration )
You can’t perform that action at this time.
0 commit comments