File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,16 @@ export class ExportsSymbolTree {
3434
3535 const typeChecker = this . program . getTypeChecker ( ) ;
3636 for ( const filePath of entrySourceFiles ) {
37- const entrySourceFile = typeChecker . getSymbolAtLocation ( this . program . getSourceFile ( filePath ) as ts . SourceFile ) ;
37+ const sourceFile = this . program . getSourceFile ( filePath ) ;
38+ if ( sourceFile === undefined ) {
39+ throw new Error ( `Cannot find source file ${ filePath } ` ) ;
40+ }
41+
42+ const entrySourceFile = typeChecker . getSymbolAtLocation ( sourceFile ) ;
3843 if ( entrySourceFile === undefined ) {
39- throw new Error ( `Cannot find symbol for source file ${ filePath } ` ) ;
44+ // if a source file doesn't have any export - then it doesn't have a symbol as well
45+ // so just skip it here
46+ continue ;
4047 }
4148
4249 for ( const entryExportSymbol of getExportsForSourceFile ( typeChecker , entrySourceFile ) ) {
You can’t perform that action at this time.
0 commit comments