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 {
264264 moduleSpecifier
265265 ) ;
266266
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.
269267 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.
270271 return true ;
271272 }
272273
@@ -868,10 +869,11 @@ export class ExportAnalyzer {
868869 ) ;
869870
870871 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.
873873 //
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.
875877 throw new InternalError (
876878 `getResolvedModule() could not resolve module name ${ JSON . stringify ( moduleSpecifier ) } \n` +
877879 SourceFileLocationFormatter . formatDeclaration ( importOrExportDeclaration )
You can’t perform that action at this time.
0 commit comments