You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(hono): Emit warning if @sentry/node was imported instead of @sentry/hono/node (#21240)
The Hono Node setup requires a separate instrumentation file with the
`Sentry.init()` call. It's important that `init` is imported from the
Hono SDK and not Node. As this could easily be overlooked, but is very
important for the correct setup, this warning is added.
'Sentry is not initialized. Call `init()` from @sentry/hono/node in an `instrument.ts` file loaded via `--import` to set up Sentry for your application.',
22
-
);
20
+
consoleSandbox(()=>{
21
+
// eslint-disable-next-line no-console
22
+
console.warn(
23
+
'[@sentry/hono] Sentry is not initialized. Call `init()` from `@sentry/hono/node` in an `instrument.ts` file loaded via `--import` to set up Sentry for your application.',
24
+
);
25
+
});
23
26
}else{
24
-
sentryClient.getOptions().debug&&
25
-
debug.log('Sentry is initialized, proceeding to set up Hono `sentry` middleware.');
'[Sentry] Sentry was not initialized with `@sentry/hono/node`. Please import from `@sentry/hono/node` to ensure Hono-specific instrumentation is applied correctly.',
34
+
);
35
+
});
36
+
}else{
37
+
sentryClient.getOptions().debug&&
38
+
debug.log('Sentry is initialized, proceeding to set up Hono `sentry` middleware.');
0 commit comments