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
97
97
} ) ;
98
98
}
99
99
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
101
103
if ( exports . default === Original ) {
102
104
try {
103
105
exports . default = WrappedOpenAI ;
104
106
} catch ( error ) {
107
+ // If direct assignment fails, override the property descriptor
105
108
Object . defineProperty ( exports , 'default' , {
106
109
value : WrappedOpenAI ,
107
110
writable : true ,
You can’t perform that action at this time.
0 commit comments