diff --git a/jestconfig.json b/jestconfig.json index 19c2be5..771d3c8 100644 --- a/jestconfig.json +++ b/jestconfig.json @@ -20,6 +20,5 @@ "TEST": true }, "testRegex": "/test/.*\\.test\\.ts$", - "collectCoverageFrom": ["src/**/*.{ts,js}"], - "useESM": true + "collectCoverageFrom": ["src/**/*.{ts,js}"] } diff --git a/src/worker.ts b/src/worker.ts index 39d8546..ba6eb8c 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -42,19 +42,21 @@ export const app = new Hono<{ } }); -app.use( - '*', - sentry({ - dsn: SENTRY_DSN, - requestDataOptions: { - allowedHeaders: /(.*)/, - allowedSearchParams: /(.*)/ - }, +if (SENTRY_DSN) { + app.use( + '*', + sentry({ + dsn: SENTRY_DSN, + requestDataOptions: { + allowedHeaders: /(.*)/, + allowedSearchParams: /(.*)/ + }, - // integrations: [new RewriteFrames({ root: '/' }) as any], - release: RELEASE_NAME - }) -); + // integrations: [new RewriteFrames({ root: '/' }) as any], + release: RELEASE_NAME + }) + ); +} app.use('*', async (c, next) => { /* Apply all headers from Constants.RESPONSE_HEADERS */