@honeybadger-io/nextjs 5.11.5 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -42
- package/dist/capture-request-error.d.ts +35 -0
- package/dist/capture-request-error.test.d.ts +2 -0
- package/dist/capture-router-transition-start.d.ts +21 -0
- package/dist/client.d.ts +2 -0
- package/dist/copy-config-files.js +106 -34
- package/dist/copy-config-files.js.map +1 -1
- package/dist/edge.d.ts +2 -1
- package/dist/flush.d.ts +24 -0
- package/dist/honeybadger-nextjs-client.cjs.js +35 -0
- package/dist/honeybadger-nextjs-client.cjs.js.map +1 -0
- package/dist/honeybadger-nextjs-client.esm.js +27 -0
- package/dist/honeybadger-nextjs-client.esm.js.map +1 -0
- package/dist/honeybadger-nextjs-edge.cjs.js +320 -240
- package/dist/honeybadger-nextjs-edge.cjs.js.map +1 -1
- package/dist/honeybadger-nextjs-edge.esm.js +317 -240
- package/dist/honeybadger-nextjs-edge.esm.js.map +1 -1
- package/dist/honeybadger-nextjs.cjs.js +835 -387
- package/dist/honeybadger-nextjs.cjs.js.map +1 -1
- package/dist/honeybadger-nextjs.esm.js +829 -386
- package/dist/honeybadger-nextjs.esm.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/insights-instrumentation.d.ts +30 -2
- package/dist/insights.d.ts +72 -0
- package/dist/insights.test.d.ts +2 -0
- package/dist/setup.d.ts +11 -0
- package/dist/setup.test.d.ts +2 -0
- package/dist/source-maps.d.ts +55 -0
- package/dist/source-maps.test.d.ts +2 -0
- package/dist/types.d.ts +20 -8
- package/package.json +34 -12
- package/src/capture-request-error.test.ts +245 -0
- package/src/capture-request-error.ts +92 -0
- package/src/capture-router-transition-start.ts +33 -0
- package/src/client.ts +4 -0
- package/src/copy-config-files.test.ts +250 -16
- package/src/copy-config-files.ts +117 -34
- package/src/edge.ts +12 -1
- package/src/flush.ts +58 -0
- package/src/index.ts +7 -2
- package/src/insights-instrumentation.ts +104 -11
- package/src/insights.test.ts +192 -0
- package/src/insights.ts +225 -0
- package/src/setup.test.ts +214 -0
- package/src/setup.ts +172 -0
- package/src/source-maps.test.ts +803 -0
- package/src/source-maps.ts +515 -0
- package/src/types.ts +38 -21
- package/templates/_error.js +14 -10
- package/templates/_error_app_router.js +1 -1
- package/templates/_error_app_router.tsx +1 -1
- package/templates/honeybadger.server.config.js +5 -16
- package/templates/instrumentation-client.js +21 -0
- package/templates/instrumentation.js +29 -0
- package/dist/webpack.d.ts +0 -3
- package/dist/with-honeybadger.d.ts +0 -32
- package/dist/with-honeybadger.test.d.ts +0 -2
- package/src/webpack.ts +0 -228
- package/src/with-honeybadger.test.ts +0 -527
- package/src/with-honeybadger.ts +0 -286
- package/templates/honeybadger.browser.config.js +0 -13
- package/templates/honeybadger.edge.config.js +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeybadger-nextjs-edge.cjs.js","sources":["../../build/insights-instrumentation.js","../../build/with-honeybadger.js"],"sourcesContent":["import Honeybadger from '@honeybadger-io/js';\n/**\n * Edge-safe equivalents of the inbound instrumentation helpers in\n * `@honeybadger-io/js` (src/server/instrumentation/http_event.ts). They are\n * duplicated here because this module must also load on the edge runtime where\n * Node builtins (the `crypto` module, `process.hrtime`) are unavailable. Keep\n * the header names and the `request_id` / `correlation_id` contract in sync\n * with that file.\n *\n * Both request shapes Next.js uses are supported: the `*RequestEventContext` /\n * `*RequestEvent` pairs come in a web-`Headers`/`Request` variant (App Router\n * route handlers and middleware) and a Node-bag variant (Pages Router API\n * routes, which only ever run on the Node runtime).\n */\nfunction generateId() {\n const webCrypto = globalThis.crypto;\n if (webCrypto && typeof webCrypto.randomUUID === 'function') {\n try {\n return webCrypto.randomUUID();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n // fall through to manual generation\n }\n }\n // v4-shaped, not crypto-quality. Acceptable since this is a correlation id,\n // not a security token.\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (ch) => {\n const r = (Math.random() * 16) | 0;\n const v = ch === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\nfunction readHeader(headers, name) {\n const value = headers.get(name);\n if (typeof value !== 'string') {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length ? trimmed : undefined;\n}\nfunction readNodeHeader(headers, name) {\n if (!headers) {\n return undefined;\n }\n const lower = name.toLowerCase();\n let value = headers[lower];\n if (value === undefined) {\n for (const key of Object.keys(headers)) {\n if (key.toLowerCase() === lower) {\n value = headers[key];\n break;\n }\n }\n }\n if (Array.isArray(value)) {\n value = value[0];\n }\n if (typeof value !== 'string') {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length ? trimmed : undefined;\n}\n// Shared id precedence. Kept in one place (rather than once per request shape)\n// so the header-name contract documented above is only spelled out once.\nfunction seedIds(read) {\n var _a, _b, _c, _d;\n const requestId = (_b = (_a = read('x-request-id')) !== null && _a !== void 0 ? _a : read('request-id')) !== null && _b !== void 0 ? _b : generateId();\n const correlationId = (_d = (_c = read('x-correlation-id')) !== null && _c !== void 0 ? _c : read('x-amzn-trace-id')) !== null && _d !== void 0 ? _d : requestId;\n return { request_id: requestId, correlation_id: correlationId };\n}\n// App Router / middleware: headers are a web `Headers` instance.\nexport function seedRequestEventContext(headers) {\n return seedIds((name) => readHeader(headers, name));\n}\n// Pages Router: headers are a Node bag (Pages routes are Node-only, never edge).\nexport function seedNodeRequestEventContext(headers) {\n return seedIds((name) => readNodeHeader(headers, name));\n}\nexport function now() {\n return typeof performance !== 'undefined' ? performance.now() : Date.now();\n}\n// Mirrors Util.resolveInsights from @honeybadger-io/core: the master gate and\n// the per-source flag must both be on.\nexport function insightsHttpEnabled() {\n const insights = Honeybadger.config.insights;\n return (insights === null || insights === void 0 ? void 0 : insights.enabled) === true && (insights === null || insights === void 0 ? void 0 : insights.http) === true;\n}\n// The ids are embedded directly in the payload (instead of relying on the\n// store's eventContext merge) so the event carries them even on the edge\n// runtime, where there is no per-request store isolation. On the Node.js\n// runtime they match the seeded event context, so embedding is a no-op.\nfunction emitHandledEvent(method, path, status, start, ids) {\n const payload = {\n method,\n duration: Math.round(now() - start),\n ...ids,\n };\n if (typeof path === 'string') {\n payload.path = path;\n }\n if (typeof status === 'number') {\n payload.status = status;\n }\n Honeybadger.event('request.handled', payload);\n}\n// App Router / middleware: `req.url` is absolute, so parse out the pathname.\nexport function emitRequestEvent(req, status, start, ids) {\n let path;\n try {\n path = new URL(req.url).pathname;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n // relative or malformed URL — leave path unset\n }\n emitHandledEvent(req.method, path, status, start, ids);\n}\n// Pages Router: `req.url` is a relative path that may carry a query string.\nexport function emitNodeRequestEvent(req, status, start, ids) {\n const path = typeof req.url === 'string' ? req.url.split('?')[0] : undefined;\n emitHandledEvent(req.method, path, status, start, ids);\n}\n//# sourceMappingURL=insights-instrumentation.js.map","import Honeybadger from '@honeybadger-io/js';\nimport * as nextServer from 'next/server';\nimport { emitNodeRequestEvent, emitRequestEvent, insightsHttpEnabled, now, seedNodeRequestEventContext, seedRequestEventContext, } from './insights-instrumentation';\n/**\n * The `waitUntil` primitive the hosting platform injects per request. Next.js\n * resolves `after()` through this same accessor, and it is the only channel\n * available in Pages Router API routes, which are invoked as `(req, res)` with\n * no context argument to read it from.\n */\nfunction requestContextWaitUntil() {\n var _a, _b;\n const context = globalThis[Symbol.for('@next/request-context')];\n const waitUntil = (_b = (_a = context === null || context === void 0 ? void 0 : context.get) === null || _a === void 0 ? void 0 : _a.call(context)) === null || _b === void 0 ? void 0 : _b.waitUntil;\n return typeof waitUntil === 'function' ? waitUntil : undefined;\n}\n/**\n * Middleware receives a `NextFetchEvent` as its second argument. Duck-typed\n * rather than `instanceof` so the edge bundle needs no runtime import, and\n * bound because `waitUntil` is a class method that collects into the event.\n */\nfunction eventWaitUntil(event) {\n const waitUntil = event === null || event === void 0 ? void 0 : event.waitUntil;\n return typeof waitUntil === 'function' ? waitUntil.bind(event) : undefined;\n}\n/**\n * Ensure Insights events are delivered before the serverless/edge runtime\n * freezes, without delaying the response where the runtime lets us avoid it.\n *\n * In order of preference: Next.js `after()` (stable in 15.1, App Router only —\n * it needs App Router request context, so Pages Router must not call it), then\n * a `waitUntil` from the middleware event or the platform request context,\n * then a blocking `flushAsync()` when the runtime offers neither. Blocking is\n * correct in that last case: no `waitUntil` means nothing is going to freeze\n * the invocation out from under us.\n *\n * Delivery failures are logged by the events worker and must not break the handler.\n */\nfunction scheduleFlush(options = {}) {\n var _a;\n const flush = () => Honeybadger.flushAsync().catch(() => { });\n if (options.useAfter) {\n const after = nextServer.after;\n if (typeof after === 'function') {\n // Exported but still refusable: `after()` throws outside a supported\n // context. Fall through to the remaining strategies rather than failing\n // the request.\n try {\n after(flush);\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n // try waitUntil / blocking flush below\n }\n }\n }\n const waitUntil = (_a = options.waitUntil) !== null && _a !== void 0 ? _a : requestContextWaitUntil();\n if (waitUntil) {\n waitUntil(flush());\n return;\n }\n return flush();\n}\nfunction configure(overrides) {\n var _a;\n if (((_a = Honeybadger.config.apiKey) === null || _a === void 0 ? void 0 : _a.length) > 0) {\n return;\n }\n let projectRoot = undefined;\n try {\n // not available on edge runtime\n projectRoot = process.cwd();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n // do nothing\n }\n Honeybadger\n .configure({\n apiKey: process.env.NEXT_PUBLIC_HONEYBADGER_API_KEY,\n environment: process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.VERCEL_ENV || process.env.NODE_ENV,\n revision: process.env.NEXT_PUBLIC_HONEYBADGER_REVISION,\n projectRoot: 'webpack://_N_E/./',\n ...overrides,\n })\n .beforeNotify((notice) => {\n if (!projectRoot) {\n return;\n }\n notice === null || notice === void 0 ? void 0 : notice.backtrace.forEach((line) => {\n if (line.file) {\n line.file = line.file.replace(`${projectRoot}/.next/server`, `${process.env.NEXT_PUBLIC_HONEYBADGER_ASSETS_URL}/..`);\n }\n return line;\n });\n });\n}\n/**\n * Next.js uses thrown errors for control flow: `redirect()`, `notFound()`,\n * `forbidden()` and `unauthorized()` all throw an error carrying a `digest`\n * string (`NEXT_REDIRECT;...`, `NEXT_NOT_FOUND`, `NEXT_HTTP_ERROR_FALLBACK;...`).\n * These are not real failures — the framework catches them upstream to produce\n * the redirect/404/etc. — so we must let them propagate without reporting them,\n * otherwise every redirect shows up as an error in Honeybadger.\n *\n * We match on the `NEXT_` prefix rather than an exhaustive list so that any\n * present or future framework control-flow digest is covered. This is safe:\n * genuine errors that React tags with a `digest` use an opaque hash, and other\n * Next.js bailout signals (e.g. `BAILOUT_TO_CLIENT_SIDE_RENDERING`,\n * `DYNAMIC_SERVER_USAGE`) are not `NEXT_`-prefixed, so neither is skipped.\n */\nfunction isNextControlFlowError(error) {\n const digest = error === null || error === void 0 ? void 0 : error.digest;\n return typeof digest === 'string' && digest.startsWith('NEXT_');\n}\n/**\n * Detects a Pages Router API invocation: `(req, res)` where `res` is a Node\n * `ServerResponse`. We branch on this structurally because — unlike an App\n * Router route handler — there is no returned `Response` to read the status\n * from; it lives on `res.statusCode`.\n */\nfunction isPagesApiInvocation(args) {\n const req = args[0];\n const res = args[1];\n return (!!req && typeof req.headers === 'object' && req.headers !== null &&\n !!res && typeof res.statusCode === 'number' && typeof res.end === 'function');\n}\n/**\n * App Router route handlers and middleware: a web `Request`/`NextRequest` in, a\n * `Response`/`NextResponse` out. The status comes from the returned response.\n *\n * `waitUntil` is present for middleware (from its `NextFetchEvent`); route\n * handlers get `{ params }` as their second argument and rely on `after()`.\n */\nasync function handleAppRouterRequest(call, req, canIsolate, waitUntil) {\n const ids = seedRequestEventContext(req.headers);\n if (canIsolate) {\n Honeybadger.setEventContext(ids);\n }\n const start = insightsHttpEnabled() ? now() : null;\n try {\n const response = await call();\n if (start !== null) {\n emitRequestEvent(req, response === null || response === void 0 ? void 0 : response.status, start, ids);\n await scheduleFlush({ useAfter: true, waitUntil });\n }\n return response;\n }\n catch (error) {\n if (isNextControlFlowError(error)) {\n throw error;\n }\n if (start !== null) {\n emitRequestEvent(req, 500, start, ids);\n await scheduleFlush({ useAfter: true, waitUntil });\n }\n await Honeybadger.notifyAsync(error);\n throw error;\n }\n}\n/**\n * Pages Router API routes: a Node `req`/`res` pair. The handler writes to `res`\n * and returns nothing meaningful, so the final status is read from\n * `res.statusCode` once it resolves.\n */\nasync function handlePagesApiRequest(call, req, res, canIsolate) {\n const ids = seedNodeRequestEventContext(req.headers);\n if (canIsolate) {\n Honeybadger.setEventContext(ids);\n }\n const start = insightsHttpEnabled() ? now() : null;\n try {\n const result = await call();\n if (start !== null) {\n emitNodeRequestEvent(req, res.statusCode, start, ids);\n // No after() here: Pages Router lacks the App Router request context it\n // needs. scheduleFlush falls through to the platform waitUntil instead.\n await scheduleFlush({ useAfter: false });\n }\n return result;\n }\n catch (error) {\n if (isNextControlFlowError(error)) {\n throw error;\n }\n if (start !== null) {\n emitNodeRequestEvent(req, 500, start, ids);\n await scheduleFlush({ useAfter: false });\n }\n await Honeybadger.notifyAsync(error);\n throw error;\n }\n}\n/**\n * Unrecognised invocation shape: still report errors, but emit no insights\n * event since we can't reliably read the request.\n */\nasync function handleUninstrumented(call) {\n try {\n return await call();\n }\n catch (error) {\n if (isNextControlFlowError(error)) {\n throw error;\n }\n await Honeybadger.notifyAsync(error);\n throw error;\n }\n}\nexport function withHoneybadger(handler, config) {\n configure(config);\n return new Proxy(handler, {\n apply: (target, thisArg, args) => {\n const canIsolate = typeof Honeybadger.run === 'function';\n const call = () => Reflect.apply(target, thisArg, args);\n const invoke = () => {\n // App Router / middleware first: a web Request as the first argument.\n if (typeof Request !== 'undefined' && args[0] instanceof Request) {\n return handleAppRouterRequest(call, args[0], canIsolate, eventWaitUntil(args[1]));\n }\n // Pages Router API route: a Node req/res pair.\n if (isPagesApiInvocation(args)) {\n return handlePagesApiRequest(call, args[0], args[1], canIsolate);\n }\n return handleUninstrumented(call);\n };\n return canIsolate ? Honeybadger.run(invoke) : invoke();\n },\n });\n}\n//# sourceMappingURL=with-honeybadger.js.map"],"names":["Honeybadger","nextServer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,GAAG;AACtB,IAAI,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC;AACxC,IAAI,IAAI,SAAS,IAAI,OAAO,SAAS,CAAC,UAAU,KAAK,UAAU,EAAE;AACjE,QAAQ,IAAI;AACZ,YAAY,OAAO,SAAS,CAAC,UAAU,EAAE,CAAC;AAC1C,SAAS;AACT;AACA,QAAQ,OAAO,KAAK,EAAE;AACtB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,IAAI,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK;AAC3E,QAAQ,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAC3C,QAAQ,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC;AACnD,QAAQ,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP,CAAC;AACD,SAAS,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE;AACnC,IAAI,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,SAAS,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;AACjC,IAAI,OAAO,OAAO,CAAC,M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AO,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtG,iBAAiB;AACjB;AACA,gBAAgB,IAAI,oBAAoB,CAAC,IAAI,CAAC,EAAE;AAChD,oBAAoB,OAAO,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACrF,iBAAiB;AACjB,gBAAgB,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;AAClD,aAAa,CAAC;AACd,YAAY,OAAO,UAAU,GAAGA,+BAAW,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC;AACnE,SAAS;AACT,KAAK,CAAC,CAAC;AACP;;;;"}
|
|
1
|
+
{"version":3,"file":"honeybadger-nextjs-edge.cjs.js","sources":["../../build/flush.js","../../build/insights-instrumentation.js","../../build/capture-request-error.js","../../build/insights.js"],"sourcesContent":["import Honeybadger from '@honeybadger-io/js';\nimport * as nextServer from 'next/server';\n/**\n * The `waitUntil` primitive the hosting platform injects per request. Next.js\n * resolves `after()` through this same accessor, and it is the only channel\n * available in Pages Router API routes, which are invoked as `(req, res)` with\n * no context argument to read it from.\n */\nexport function requestContextWaitUntil() {\n var _a, _b;\n const context = globalThis[Symbol.for('@next/request-context')];\n const waitUntil = (_b = (_a = context === null || context === void 0 ? void 0 : context.get) === null || _a === void 0 ? void 0 : _a.call(context)) === null || _b === void 0 ? void 0 : _b.waitUntil;\n return typeof waitUntil === 'function' ? waitUntil : undefined;\n}\n/**\n * Ensure events are delivered before a serverless runtime freezes, without\n * delaying the response where the runtime lets us avoid it.\n *\n * In order of preference: Next.js `after()` (App Router only — it needs App Router\n * request context, so Pages Router must not call it), then a `waitUntil` from the\n * platform request context, then a blocking `flushAsync()` when the runtime offers\n * neither.\n *\n * Delivery failures are logged by the events worker and must not break the handler.\n */\nexport function scheduleFlush(options = {}) {\n var _a;\n const flush = () => Honeybadger.flushAsync().catch(() => { });\n if (options.useAfter) {\n const after = nextServer.after;\n if (typeof after === 'function') {\n // Exported but still refusable: `after()` throws outside a supported\n // context. Fall through to the remaining strategies rather than failing\n // the request.\n try {\n after(flush);\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n // try waitUntil / blocking flush below\n }\n }\n }\n const waitUntil = (_a = options.waitUntil) !== null && _a !== void 0 ? _a : requestContextWaitUntil();\n if (waitUntil) {\n waitUntil(flush());\n return;\n }\n return flush();\n}\n//# sourceMappingURL=flush.js.map","import Honeybadger from '@honeybadger-io/js';\n/**\n * Edge-safe equivalents of the inbound instrumentation helpers in\n * `@honeybadger-io/js` (src/server/instrumentation/http_event.ts). They are\n * duplicated here because this module must load in every runtime where\n * Node builtins (the `crypto` module, `process.hrtime`) are unavailable. Keep\n * the header names and the `request_id` / `correlation_id` contract in sync\n * with that file.\n *\n * Both request shapes Next.js uses are supported: the `*RequestEventContext` /\n * `*RequestEvent` pairs come in a web-`Headers`/`Request` variant (App Router\n * route handlers and middleware) and a Node-bag variant (Pages Router API\n * routes, which only ever run on the Node runtime).\n */\nfunction generateId() {\n const webCrypto = globalThis.crypto;\n if (webCrypto && typeof webCrypto.randomUUID === 'function') {\n try {\n return webCrypto.randomUUID();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n // fall through to manual generation\n }\n }\n // v4-shaped, not crypto-quality. Acceptable since this is a correlation id,\n // not a security token.\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (ch) => {\n const r = (Math.random() * 16) | 0;\n const v = ch === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\nfunction readHeader(headers, name) {\n const value = headers.get(name);\n if (typeof value !== 'string') {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length ? trimmed : undefined;\n}\nfunction readNodeHeader(headers, name) {\n if (!headers) {\n return undefined;\n }\n const lower = name.toLowerCase();\n let value = headers[lower];\n if (value === undefined) {\n for (const key of Object.keys(headers)) {\n if (key.toLowerCase() === lower) {\n value = headers[key];\n break;\n }\n }\n }\n if (Array.isArray(value)) {\n value = value[0];\n }\n if (typeof value !== 'string') {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length ? trimmed : undefined;\n}\n/**\n * Shared id precedence. Kept in one place (rather than once per request shape)\n * so the header-name contract documented above is only spelled out once.\n *\n * The span ids do double duty. They are emitted as `trace_id` / `span_id`, and they also\n * back-fill `request_id` / `correlation_id` when no header supplied them — a trace id\n * already has exactly the semantics we want for a correlation id, since W3C trace context\n * reuses an inbound `traceparent` and mints a new one when there is none.\n *\n * That double duty is what makes a fault joinable to its request's events: both paths seed\n * from the same span, so with no id headers present a fault and its `request.handled` event\n * carry identical values for all four.\n */\nfunction seedIds(read, span = {}) {\n var _a, _b, _c, _d, _e, _f;\n const requestId = (_c = (_b = (_a = read('x-request-id')) !== null && _a !== void 0 ? _a : read('request-id')) !== null && _b !== void 0 ? _b : span.spanId) !== null && _c !== void 0 ? _c : generateId();\n const correlationId = (_f = (_e = (_d = read('x-correlation-id')) !== null && _d !== void 0 ? _d : read('x-amzn-trace-id')) !== null && _e !== void 0 ? _e : span.traceId) !== null && _f !== void 0 ? _f : requestId;\n const ids = { request_id: requestId, correlation_id: correlationId };\n if (span.traceId) {\n ids.trace_id = span.traceId;\n }\n if (span.spanId) {\n ids.span_id = span.spanId;\n }\n return ids;\n}\n/**\n * The active span's ids, or an empty object when OpenTelemetry is not in play.\n *\n * `@opentelemetry/api` is an optional peer dependency, and this module is reachable from\n * every runtime entry point, so it is loaded on demand and any failure to resolve it is\n * treated as \"no tracing configured\" rather than an error.\n */\nexport async function activeSpanIds() {\n var _a;\n try {\n const { trace } = await import('@opentelemetry/api');\n const spanContext = (_a = trace.getActiveSpan()) === null || _a === void 0 ? void 0 : _a.spanContext();\n if (!spanContext) {\n return {};\n }\n return { traceId: spanContext.traceId, spanId: spanContext.spanId };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n return {};\n }\n}\n// App Router / middleware: headers are a web `Headers` instance.\nexport function seedRequestEventContext(headers, span = {}) {\n return seedIds((name) => readHeader(headers, name), span);\n}\n// Pages Router: headers are a Node bag (Pages routes are Node-only, never edge).\nexport function seedNodeRequestEventContext(headers, span = {}) {\n return seedIds((name) => readNodeHeader(headers, name), span);\n}\nexport function now() {\n return typeof performance !== 'undefined' ? performance.now() : Date.now();\n}\n// Mirrors Util.resolveInsights from @honeybadger-io/core: the master gate and\n// the per-source flag must both be on.\nexport function insightsHttpEnabled() {\n const insights = Honeybadger.config.insights;\n return (insights === null || insights === void 0 ? void 0 : insights.enabled) === true && (insights === null || insights === void 0 ? void 0 : insights.http) === true;\n}\n// The ids are embedded directly in the payload (instead of relying on the\n// store's eventContext merge) so the event carries them even where the\n// runtime, where there is no per-request store isolation. On the Node.js\n// runtime they match the seeded event context, so embedding is a no-op.\nfunction emitHandledEvent(method, path, status, start, ids) {\n const payload = {\n method,\n duration: Math.round(now() - start),\n ...ids,\n };\n if (typeof path === 'string') {\n payload.path = path;\n }\n if (typeof status === 'number') {\n payload.status = status;\n }\n Honeybadger.event('request.handled', payload);\n}\n// App Router / middleware: `req.url` is absolute, so parse out the pathname.\nexport function emitRequestEvent(req, status, start, ids) {\n let path;\n try {\n path = new URL(req.url).pathname;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n // relative or malformed URL — leave path unset\n }\n emitHandledEvent(req.method, path, status, start, ids);\n}\n// Pages Router: `req.url` is a relative path that may carry a query string.\nexport function emitNodeRequestEvent(req, status, start, ids) {\n const path = typeof req.url === 'string' ? req.url.split('?')[0] : undefined;\n emitHandledEvent(req.method, path, status, start, ids);\n}\n/**\n * OpenTelemetry path. Header values are not on the span by default; they arrive as\n * `http.request.header.*` attributes when the HTTP instrumentation is configured with\n * `headersToSpanAttributes`. Hyphens become underscores under the older semantic\n * conventions and are preserved under the stable ones, so both spellings are read.\n *\n * When no header is present the span and trace ids are used, so the ids stay\n * meaningful — and joinable to a trace — on platforms where the HTTP layer is not\n * visible, such as serverless platforms.\n */\nexport function seedSpanEventContext(attributes, spanContext) {\n const read = (name) => {\n const lower = name.toLowerCase();\n for (const key of [\n `http.request.header.${lower}`,\n `http.request.header.${lower.replace(/-/g, '_')}`,\n ]) {\n const value = attributes[key];\n const first = Array.isArray(value) ? value[0] : value;\n if (typeof first === 'string' && first.trim().length) {\n return first.trim();\n }\n }\n return undefined;\n };\n return seedIds(read, {\n traceId: spanContext.traceId || undefined,\n spanId: spanContext.spanId || undefined,\n });\n}\n//# sourceMappingURL=insights-instrumentation.js.map","import Honeybadger from '@honeybadger-io/js';\nimport { scheduleFlush } from './flush';\nimport { activeSpanIds, seedNodeRequestEventContext } from './insights-instrumentation';\n/**\n * Next.js uses thrown errors for control flow: `redirect()`, `notFound()`,\n * `forbidden()` and `unauthorized()` all throw an error carrying a `digest`\n * string (`NEXT_REDIRECT;...`, `NEXT_NOT_FOUND`, `NEXT_HTTP_ERROR_FALLBACK;...`).\n * These are not real failures — the framework catches them upstream to produce\n * the redirect/404/etc. — so we must let them pass without reporting, otherwise\n * every redirect shows up as an error in Honeybadger.\n *\n * We match on the `NEXT_` prefix rather than an exhaustive list so that any\n * present or future framework control-flow digest is covered. This is safe:\n * genuine errors that React tags with a `digest` use an opaque hash, and other\n * Next.js bailout signals (e.g. `BAILOUT_TO_CLIENT_SIDE_RENDERING`,\n * `DYNAMIC_SERVER_USAGE`) are not `NEXT_`-prefixed, so neither is skipped.\n */\nfunction isNextControlFlowError(error) {\n const digest = error === null || error === void 0 ? void 0 : error.digest;\n return typeof digest === 'string' && digest.startsWith('NEXT_');\n}\n/**\n * Reports errors passed to Next.js's `onRequestError` instrumentation hook.\n *\n * Wire it up in `instrumentation.ts`:\n *\n * ```ts\n * export const onRequestError = captureRequestError\n * ```\n *\n * Reaches Server Components, Route Handlers, Server Actions and middleware, and receives\n * the real error rather than the generic message Next.js hands to an error component.\n */\nexport async function captureRequestError(error, request, context) {\n if (isNextControlFlowError(error)) {\n return;\n }\n // Same header precedence *and* the same span as the Insights path, so a fault and the\n // events from the request it failed in carry matching ids. Next.js still has the request\n // span active when it calls this hook, and it is the very span the Insights processor\n // maps to `request.handled` — so with no id headers present all four ids are identical on\n // both, and the fault joins its request's events and trace.\n //\n // Deliberately not written to the event context: outside a `Honeybadger.run()` that\n // lands on a store shared by the whole process or isolate, so the ids would leak into\n // later requests' events. `onRequestError` also fires after the request has already\n // failed, so it is too late to decorate that request's own events anyway.\n const ids = seedNodeRequestEventContext(request.headers, await activeSpanIds());\n await Honeybadger.notifyAsync(error, {\n context: {\n ...ids,\n path: request.path,\n method: request.method,\n router_kind: context.routerKind,\n route_path: context.routePath,\n route_type: context.routeType,\n },\n });\n await scheduleFlush({ useAfter: true });\n}\n//# sourceMappingURL=capture-request-error.js.map","import Honeybadger from '@honeybadger-io/js';\nimport { insightsHttpEnabled, seedSpanEventContext } from './insights-instrumentation';\nimport { scheduleFlush } from './flush';\n/**\n * Next.js instruments itself with OpenTelemetry and emits one root span per request,\n * `[http.method] [next.route]`, tagged `next.span_type: BaseServer.handleRequest`. Its\n * attributes carry the method, route, target and status, so mapping that span to a\n * `request.handled` event reports every request without wrapping any handler.\n *\n * Next instruments but does not export: spans only reach us once a tracer provider with\n * this processor is registered. See `registerHoneybadgerInsights`.\n */\nconst NEXT_REQUEST_SPAN_TYPE = 'BaseServer.handleRequest';\n/**\n * Request headers to copy onto the root span, so `request_id` and `correlation_id` can be\n * reused from an inbound request instead of falling back to the span and trace ids.\n *\n * Header values are not span attributes by default. `@vercel/otel` applies this map when\n * it creates the root span, which is the span this processor reads — and, unlike Node's\n * HTTP instrumentation, it works on serverless platforms too.\n *\n * Spread it into your own `registerOTel` call if you register OpenTelemetry yourself:\n *\n * ```ts\n * registerOTel({\n * attributesFromHeaders: { ...HONEYBADGER_HEADER_ATTRIBUTES },\n * spanProcessors: [honeybadgerSpanProcessor()],\n * })\n * ```\n *\n * Keep the header names in sync with `seedIds` in ./insights-instrumentation.\n */\nexport const HONEYBADGER_HEADER_ATTRIBUTES = {\n 'http.request.header.x-request-id': 'x-request-id',\n 'http.request.header.request-id': 'request-id',\n 'http.request.header.x-correlation-id': 'x-correlation-id',\n 'http.request.header.x-amzn-trace-id': 'x-amzn-trace-id',\n};\nfunction readString(attributes, ...names) {\n for (const name of names) {\n const value = attributes[name];\n if (typeof value === 'string' && value.length) {\n return value;\n }\n }\n return undefined;\n}\nfunction readNumber(attributes, ...names) {\n for (const name of names) {\n const value = attributes[name];\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string' && value.trim().length && Number.isFinite(Number(value))) {\n return Number(value);\n }\n }\n return undefined;\n}\nfunction durationMs(duration) {\n if (!Array.isArray(duration) || duration.length !== 2) {\n return 0;\n }\n const [seconds, nanos] = duration;\n return Math.round(seconds * 1000 + nanos / 1e6);\n}\n/**\n * Path without the query string. `http.target` includes the query under the older\n * semantic conventions; `url.path` is already bare under the stable ones.\n */\nfunction readPath(attributes) {\n const target = readString(attributes, 'url.path', 'http.target');\n return typeof target === 'string' ? target.split('?')[0] : undefined;\n}\n/**\n * Maps Next.js's per-request span to a Honeybadger `request.handled` Insights event.\n *\n * Pass it to whatever registers OpenTelemetry in your `instrumentation.ts`:\n *\n * ```ts\n * import { registerOTel } from '@vercel/otel'\n * import { honeybadgerSpanProcessor } from '@honeybadger-io/nextjs'\n *\n * export function register() {\n * registerOTel({ serviceName: 'my-app', spanProcessors: [honeybadgerSpanProcessor()] })\n * }\n * ```\n *\n * `registerHoneybadgerInsights()` is the one-line equivalent when you have no other\n * OpenTelemetry setup of your own.\n */\nexport function honeybadgerSpanProcessor() {\n return {\n onStart() {\n // Nothing to do: the event is emitted once the request span is complete, which is\n // when the status and duration are known.\n },\n onEnd(span) {\n var _a;\n const attributes = (_a = span.attributes) !== null && _a !== void 0 ? _a : {};\n if (attributes['next.span_type'] !== NEXT_REQUEST_SPAN_TYPE) {\n return;\n }\n // Checked per event rather than at registration: configuration is loaded by\n // `register()` importing the honeybadger config files, which may happen after the\n // processor is constructed.\n if (!insightsHttpEnabled()) {\n return;\n }\n const spanContext = typeof span.spanContext === 'function' ? span.spanContext() : {};\n const ids = seedSpanEventContext(attributes, spanContext !== null && spanContext !== void 0 ? spanContext : {});\n const payload = {\n method: readString(attributes, 'http.request.method', 'http.method'),\n duration: durationMs(span.duration),\n ...ids,\n };\n const path = readPath(attributes);\n if (path) {\n payload.path = path;\n }\n const status = readNumber(attributes, 'http.response.status_code', 'http.status_code');\n if (typeof status === 'number') {\n payload.status = status;\n }\n // Emitted alongside the ids rather than replacing them, so an event can be joined\n // to a trace in another tool without changing what existing consumers read.\n if (spanContext === null || spanContext === void 0 ? void 0 : spanContext.traceId) {\n payload.trace_id = spanContext.traceId;\n }\n if (spanContext === null || spanContext === void 0 ? void 0 : spanContext.spanId) {\n payload.span_id = spanContext.spanId;\n }\n Honeybadger.event('request.handled', payload);\n // A span processor batches on its own lifecycle, which is not enough on a platform\n // that can freeze the invocation as soon as the response is sent.\n scheduleFlush({ useAfter: true });\n },\n async forceFlush() {\n await Honeybadger.flushAsync().catch(() => { });\n },\n async shutdown() {\n await Honeybadger.flushAsync().catch(() => { });\n },\n };\n}\n/**\n * Registers OpenTelemetry with only Honeybadger's span processor attached, for apps that\n * have no OpenTelemetry setup of their own. Call it from `register()` in\n * `instrumentation.ts`.\n *\n * `@vercel/otel` is an optional peer dependency: it is only needed for Insights, and it\n * loads where the full Node SDK cannot, such as serverless platforms. If you\n * already call `registerOTel` yourself, add `honeybadgerSpanProcessor()` to your\n * `spanProcessors` instead of calling this — registering twice would compete for the\n * global provider.\n */\nexport async function registerHoneybadgerInsights(options = {}) {\n var _a, _b;\n let registerOTel;\n try {\n ({ registerOTel } = await import('@vercel/otel'));\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n catch (error) {\n Honeybadger.logger.error('[Honeybadger] Insights request events need @vercel/otel. Install it, or drop the ' +\n 'registerHoneybadgerInsights() call — error reporting works without it.');\n return;\n }\n registerOTel({\n serviceName: (_b = (_a = options.serviceName) !== null && _a !== void 0 ? _a : process.env.NEXT_PUBLIC_HONEYBADGER_SERVICE_NAME) !== null && _b !== void 0 ? _b : 'nextjs-app',\n // Without this the id headers never reach the span, so request_id and\n // correlation_id would always fall back to the span and trace ids.\n attributesFromHeaders: {\n ...HONEYBADGER_HEADER_ATTRIBUTES,\n ...options.attributesFromHeaders,\n },\n spanProcessors: [honeybadgerSpanProcessor()],\n });\n}\n//# sourceMappingURL=insights.js.map"],"names":["Honeybadger","nextServer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,GAAG;AAC1C,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;AACpE,IAAI,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;AAC1M,IAAI,OAAO,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AACnE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,OAAO,GAAG,EAAE,EAAE;AAC5C,IAAI,IAAI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