File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/node/src/integrations/tracing/hono Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export class HonoInstrumentation extends InstrumentationBase {
41
41
// eslint-disable-next-line @typescript-eslint/no-this-alias
42
42
const instrumentation = this ;
43
43
44
- moduleExports . Hono = class HonoWrapper extends moduleExports . Hono {
44
+ class WrappedHono extends moduleExports . Hono {
45
45
public constructor ( ...args : unknown [ ] ) {
46
46
super ( ...args ) ;
47
47
@@ -55,7 +55,15 @@ export class HonoInstrumentation extends InstrumentationBase {
55
55
instrumentation . _wrap ( this , 'on' , instrumentation . _patchOnHandler ( ) ) ;
56
56
instrumentation . _wrap ( this , 'use' , instrumentation . _patchMiddlewareHandler ( ) ) ;
57
57
}
58
- } ;
58
+ }
59
+
60
+ try {
61
+ moduleExports . Hono = WrappedHono ;
62
+ } catch {
63
+ // This is a workaround for environments where direct assignment is not allowed.
64
+ return { ...moduleExports , Hono : WrappedHono } ;
65
+ }
66
+
59
67
return moduleExports ;
60
68
}
61
69
You can’t perform that action at this time.
0 commit comments