File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/node/src/integrations/tracing/openai Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -97,11 +97,14 @@ export class SentryOpenAiInstrumentation extends InstrumentationBase<Instrumenta
9797 } ) ;
9898 }
9999
100- // Also wrap the default export if it points to the original constructor
100+ // Wrap the default export if it points to the original constructor
101+ // Constructor replacement - handle read-only properties
102+ // The OpenAI property might have only a getter, so use defineProperty
101103 if ( exports . default === Original ) {
102104 try {
103105 exports . default = WrappedOpenAI ;
104106 } catch ( error ) {
107+ // If direct assignment fails, override the property descriptor
105108 Object . defineProperty ( exports , 'default' , {
106109 value : WrappedOpenAI ,
107110 writable : true ,
You can’t perform that action at this time.
0 commit comments