File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,18 @@ export type SelectorEngine = Parameters<typeof selectors.register>[1]
77const  selectorEngine  =  ( fileName : string ) : SelectorEngine  =>  ( { 
88    // https://github.com/microsoft/playwright/issues/36448 
99    content : `(() => { 
10-         if (typeof module === 'undefined') { 
10+         const useFakeModule = typeof module === 'undefined' 
11+         if (useFakeModule) { 
1112            window.module = {exports: {}}; 
1213        } 
13-         ${ readFileSync ( join ( __dirname ,  `../../dist/browser/${ fileName }  .js` ) ,  'utf8' ) }  ; 
14+         try { 
15+             ${ readFileSync ( join ( __dirname ,  `../../dist/browser/${ fileName }  .js` ) ,  'utf8' ) }  ; 
16+             return module.exports.default 
17+         } finally { 
18+             if (useFakeModule) { 
19+                 delete module 
20+             } 
21+         } 
1422        return module.exports.default 
1523    })()` , 
1624} ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments