File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -892,10 +892,15 @@ protected DependencyInstallationResult preparePackagesAndDependencies(Set<Path>
892892 // For named packages, find the main file.
893893 String name = packageJson .getName ();
894894 if (name != null ) {
895- Path entryPoint = guessPackageMainFile (path , packageJson , FileType .TYPESCRIPT .getExtensions ());
896- if (entryPoint == null ) {
897- // Try a TypeScript-recognized JS extension instead
898- entryPoint = guessPackageMainFile (path , packageJson , Arrays .asList (".js" , ".jsx" ));
895+ Path entryPoint = null ;
896+ try {
897+ entryPoint = guessPackageMainFile (path , packageJson , FileType .TYPESCRIPT .getExtensions ());
898+ if (entryPoint == null ) {
899+ // Try a TypeScript-recognized JS extension instead
900+ entryPoint = guessPackageMainFile (path , packageJson , Arrays .asList (".js" , ".jsx" ));
901+ }
902+ } catch (InvalidPathException ignore ) {
903+ // can happen if the `main:` field is invalid. E.g. on Windows a path like `dist/*.js` will crash.
899904 }
900905 if (entryPoint != null ) {
901906 System .out .println (relativePath + ": Main file set to " + sourceRoot .relativize (entryPoint ));
You can’t perform that action at this time.
0 commit comments