File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,13 @@ function _init(
142142        typeof  __IMPORT_META_URL_REPLACEMENT__  !==  'undefined'  ? __IMPORT_META_URL_REPLACEMENT__  : undefined ; 
143143
144144      if  ( ! GLOBAL_OBJ . _sentryEsmLoaderHookRegistered  &&  importMetaUrl )  { 
145-         // @ts -expect-error register is available in these versions 
146-         moduleModule . register ( '@opentelemetry/instrumentation/hook.mjs' ,  importMetaUrl ) ; 
147-         GLOBAL_OBJ . _sentryEsmLoaderHookRegistered  =  true ; 
145+         try  { 
146+           // @ts -expect-error register is available in these versions 
147+           moduleModule . register ( '@opentelemetry/instrumentation/hook.mjs' ,  importMetaUrl ) ; 
148+           GLOBAL_OBJ . _sentryEsmLoaderHookRegistered  =  true ; 
149+         }  catch  ( error )  { 
150+           logger . warn ( 'Failed to register ESM hook' ,  error ) ; 
151+         } 
148152      } 
149153    }  else  { 
150154      consoleSandbox ( ( )  =>  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments