File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed 
packages/react-scripts/scripts/utils Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,11 @@ function verifyTypeScriptSetup() {
5252  const  isYarn  =  fs . existsSync ( paths . yarnLockFile ) ; 
5353
5454  // Ensure typescript is installed 
55+   let  ts ; 
5556  try  { 
56-     resolve . sync ( 'typescript' ,  { 
57+     ts   =   require ( resolve . sync ( 'typescript' ,  { 
5758      basedir : paths . appNodeModules , 
58-     } ) ; 
59+     } ) ) ; 
5960  }  catch  ( _ )  { 
6061    console . error ( 
6162      chalk . red ( 
@@ -88,7 +89,16 @@ function verifyTypeScriptSetup() {
8889  const  messages  =  [ ] ; 
8990  let  tsconfig ; 
9091  try  { 
91-     tsconfig  =  require ( paths . appTsConfig ) ; 
92+     const  {  config,  error }  =  ts . readConfigFile ( 
93+       paths . appTsConfig , 
94+       ts . sys . readFile 
95+     ) ; 
96+ 
97+     if  ( error )  { 
98+       throw  error ; 
99+     } 
100+ 
101+     tsconfig  =  config ; 
92102  }  catch  ( _ )  { 
93103    console . error ( 
94104      chalk . red . bold ( 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments