File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,10 @@ namespace ts {
485
485
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
486
486
// (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
487
487
let options : any ;
488
- if ( ! directoryExists ( directoryName ) ) {
488
+ if ( ! directoryExists ( directoryName ) || ( isUNCPath ( directoryName ) && process . platform === "win32" ) ) {
489
+ // do nothing if either
490
+ // - target folder does not exist
491
+ // - this is UNC path on Windows (https://github.com/Microsoft/TypeScript/issues/13874)
489
492
return noOpFileWatcher ;
490
493
}
491
494
@@ -509,6 +512,10 @@ namespace ts {
509
512
} ;
510
513
}
511
514
) ;
515
+
516
+ function isUNCPath ( s : string ) : boolean {
517
+ return s . length > 2 && s . charCodeAt ( 0 ) === CharacterCodes . slash && s . charCodeAt ( 1 ) === CharacterCodes . slash ;
518
+ }
512
519
} ,
513
520
resolvePath : function ( path : string ) : string {
514
521
return _path . resolve ( path ) ;
You can’t perform that action at this time.
0 commit comments