File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,14 @@ impl FileSystem for FileSystemOs {
213213    } 
214214
215215    async  fn  metadata ( & self ,  path :  & Path )  -> io:: Result < FileMetadata >  { 
216+         // This implementation is verbose because there might be something wrong node wasm runtime. 
217+         // I will investigate it in the future. 
218+         if  let  Ok ( m)  = std:: fs:: metadata ( path) . map ( FileMetadata :: from)  { 
219+             return  Ok ( m) ; 
220+         } 
221+ 
222+         self . symlink_metadata ( path) . await ?; 
223+         let  path = self . canonicalize ( path) . await ?; 
216224        std:: fs:: metadata ( path) . map ( FileMetadata :: from) 
217225    } 
218226
Original file line number Diff line number Diff line change @@ -263,8 +263,6 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
263263
264264        let  package_json =
265265            cached_path. find_package_json ( & self . cache . fs ,  & self . options ,  ctx) . await ?; 
266-         // FIXME: something wrong with [std::fs::metadata] in wasm 
267-         #[ cfg( not( target_arch = "wasm32" ) ) ]  
268266        if  let  Some ( package_json)  = & package_json { 
269267            // path must be inside the package. 
270268            debug_assert ! ( path. starts_with( package_json. directory( ) ) ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments