diff --git a/deno.json b/deno.json index d2412626..6d047329 100644 --- a/deno.json +++ b/deno.json @@ -17,6 +17,7 @@ "imports": { "@/": "./src/", "@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.15.0", + "@sentry/deno": "npm:@sentry/deno@^7.112.2", "@std/cli": "jsr:@std/cli@^0.223.0", "@std/crypto": "jsr:@std/crypto@^0.224.0", "@std/encoding": "jsr:@std/encoding@^0.224.0", diff --git a/src/app.ts b/src/app.ts index e58d1cb6..9911f0cf 100644 --- a/src/app.ts +++ b/src/app.ts @@ -2,10 +2,9 @@ import { NostrEvent, NStore } from '@nostrify/nostrify'; import { type Context, Env as HonoEnv, type Handler, Hono, Input as HonoInput, type MiddlewareHandler } from 'hono'; import { cors, logger, serveStatic } from 'hono/middleware'; -import { Conf } from '@/config.ts'; import '@/cron.ts'; import { type User } from '@/db/users.ts'; -import { Debug, sentryMiddleware } from '@/deps.ts'; +import { Debug } from '@/deps.ts'; import '@/firehose.ts'; import { Time } from '@/utils.ts'; @@ -101,17 +100,6 @@ type AppController = Handler(); -if (Conf.sentryDsn) { - // @ts-ignore Mismatched hono types. - app.use( - '*', - sentryMiddleware({ - dsn: Conf.sentryDsn, - ignoreErrors: ['No pubkey provided'], - }), - ); -} - const debug = Debug('ditto:http'); app.use('/api/*', logger(debug)); diff --git a/src/deps.ts b/src/deps.ts index 3beda47a..f7e09cbf 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -62,8 +62,6 @@ export { S3Client } from 'https://deno.land/x/s3_lite_client@0.6.1/mod.ts'; export { default as IpfsHash } from 'npm:ipfs-only-hash@^4.0.0'; export { default as uuid62 } from 'npm:uuid62@^1.0.2'; export { Machina } from 'https://gitlab.com/soapbox-pub/nostr-machina/-/raw/08a157d39f2741c9a3a4364cb97db36e71d8c03a/mod.ts'; -export * as Sentry from 'https://deno.land/x/sentry@7.78.0/index.js'; -export { sentry as sentryMiddleware } from 'npm:@hono/sentry@^1.0.0'; export * as Comlink from 'npm:comlink@^4.4.1'; export { EventEmitter } from 'npm:tseep@^1.1.3'; export { default as stringifyStable } from 'npm:fast-stable-stringify@^1.0.0'; diff --git a/src/sentry.ts b/src/sentry.ts index eefe9c59..84b662e2 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -1,5 +1,6 @@ -import { Conf } from './config.ts'; -import { Sentry } from './deps.ts'; +import * as Sentry from '@sentry/deno'; + +import { Conf } from '@/config.ts'; // Sentry if (Conf.sentryDsn) {