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 {
4141 // eslint-disable-next-line @typescript-eslint/no-this-alias
4242 const instrumentation = this ;
4343
44- moduleExports . Hono = class HonoWrapper extends moduleExports . Hono {
44+ class WrappedHono extends moduleExports . Hono {
4545 public constructor ( ...args : unknown [ ] ) {
4646 super ( ...args ) ;
4747
@@ -55,7 +55,15 @@ export class HonoInstrumentation extends InstrumentationBase {
5555 instrumentation . _wrap ( this , 'on' , instrumentation . _patchOnHandler ( ) ) ;
5656 instrumentation . _wrap ( this , 'use' , instrumentation . _patchMiddlewareHandler ( ) ) ;
5757 }
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+
5967 return moduleExports ;
6068 }
6169
You can’t perform that action at this time.
0 commit comments