Skip to content

Commit b1f2cae

Browse files
cursoragentclaude
andcommitted
fix(nuxt): remove duplicate legacy handler patch
Co-Authored-By: gpt-5.3-codex-high <noreply@anthropic.com>
1 parent 9c9528e commit b1f2cae

1 file changed

Lines changed: 2 additions & 33 deletions

File tree

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
import{
2-
debug,
3-
flushIfServerless,
4-
getDefaultIsolationScope,
5-
getIsolationScope,
6-
withIsolationScope,
7-
}from'@sentry/core';
8-
importtype{EventHandler,H3Event}from'h3';
1+
import{debug}from'@sentry/core';
2+
importtype{H3Event}from'h3';
93
importtype{NitroAppPlugin}from'nitropack';
104
importtype{NuxtRenderHTMLContext}from'nuxt/app';
115
import{sentryCaptureErrorHook}from'../hooks/captureErrorHook';
126
import{updateRouteBeforeResponse}from'../hooks/updateRouteBeforeResponse';
137
import{addSentryTracingMetaTags}from'../utils';
148

159
exportdefault(nitroApp=>{
16-
nitroApp.h3App.handler=patchEventHandler(nitroApp.h3App.handler);
17-
1810
nitroApp.hooks.hook('beforeResponse',updateRouteBeforeResponse);
1911

2012
nitroApp.hooks.hook('error',sentryCaptureErrorHook);
@@ -37,26 +29,3 @@ export default (nitroApp => {
3729
}
3830
});
3931
})satisfiesNitroAppPlugin;
40-
41-
functionpatchEventHandler(handler: EventHandler): EventHandler{
42-
returnnewProxy(handler,{
43-
asyncapply(handlerTarget,handlerThisArg,handlerArgs: Parameters<EventHandler>){
44-
constisolationScope=getIsolationScope();
45-
constnewIsolationScope=isolationScope===getDefaultIsolationScope() ? isolationScope.clone() : isolationScope;
46-
47-
debug.log(
48-
`Patched h3 event handler. ${
49-
isolationScope===newIsolationScope ? 'Using existing' : 'Created new'
50-
} isolation scope.`,
51-
);
52-
53-
returnwithIsolationScope(newIsolationScope,async()=>{
54-
try{
55-
returnawaithandlerTarget.apply(handlerThisArg,handlerArgs);
56-
}finally{
57-
awaitflushIfServerless();
58-
}
59-
});
60-
},
61-
});
62-
}

0 commit comments

Comments
 (0)