@honeybadger-io/nextjs 5.10.13 → 5.11.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.
@@ -6,13 +6,33 @@ var fs = require('fs');
6
6
  var path = require('path');
7
7
  var HoneybadgerSourceMapPlugin = require('@honeybadger-io/webpack');
8
8
  var Honeybadger = require('@honeybadger-io/js');
9
+ var nextServer = require('next/server');
9
10
 
10
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
12
 
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n["default"] = e;
28
+ return Object.freeze(n);
29
+ }
30
+
12
31
  var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
13
32
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
14
33
  var HoneybadgerSourceMapPlugin__default = /*#__PURE__*/_interopDefaultLegacy(HoneybadgerSourceMapPlugin);
15
34
  var Honeybadger__default = /*#__PURE__*/_interopDefaultLegacy(Honeybadger);
35
+ var nextServer__namespace = /*#__PURE__*/_interopNamespace(nextServer);
16
36
 
17
37
  const URL_DOCS_SOURCE_MAPS_UPLOAD = 'https://docs.honeybadger.io/lib/javascript/integration/nextjs/#source-map-upload-and-tracking-deploys';
18
38
  let _silent = true;
@@ -205,7 +225,191 @@ function setupHoneybadger(config, honeybadgerNextJsConfig) {
205
225
  };
206
226
  }
207
227
 
208
- function configure() {
228
+ /**
229
+ * Edge-safe equivalents of the inbound instrumentation helpers in
230
+ * `@honeybadger-io/js` (src/server/instrumentation/http_event.ts). They are
231
+ * duplicated here because this module must also load on the edge runtime where
232
+ * Node builtins (the `crypto` module, `process.hrtime`) are unavailable. Keep
233
+ * the header names and the `request_id` / `correlation_id` contract in sync
234
+ * with that file.
235
+ *
236
+ * Both request shapes Next.js uses are supported: the `*RequestEventContext` /
237
+ * `*RequestEvent` pairs come in a web-`Headers`/`Request` variant (App Router
238
+ * route handlers and middleware) and a Node-bag variant (Pages Router API
239
+ * routes, which only ever run on the Node runtime).
240
+ */
241
+ function generateId() {
242
+ const webCrypto = globalThis.crypto;
243
+ if (webCrypto && typeof webCrypto.randomUUID === 'function') {
244
+ try {
245
+ return webCrypto.randomUUID();
246
+ }
247
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
248
+ catch (error) {
249
+ // fall through to manual generation
250
+ }
251
+ }
252
+ // v4-shaped, not crypto-quality. Acceptable since this is a correlation id,
253
+ // not a security token.
254
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (ch) => {
255
+ const r = (Math.random() * 16) | 0;
256
+ const v = ch === 'x' ? r : (r & 0x3) | 0x8;
257
+ return v.toString(16);
258
+ });
259
+ }
260
+ function readHeader(headers, name) {
261
+ const value = headers.get(name);
262
+ if (typeof value !== 'string') {
263
+ return undefined;
264
+ }
265
+ const trimmed = value.trim();
266
+ return trimmed.length ? trimmed : undefined;
267
+ }
268
+ function readNodeHeader(headers, name) {
269
+ if (!headers) {
270
+ return undefined;
271
+ }
272
+ const lower = name.toLowerCase();
273
+ let value = headers[lower];
274
+ if (value === undefined) {
275
+ for (const key of Object.keys(headers)) {
276
+ if (key.toLowerCase() === lower) {
277
+ value = headers[key];
278
+ break;
279
+ }
280
+ }
281
+ }
282
+ if (Array.isArray(value)) {
283
+ value = value[0];
284
+ }
285
+ if (typeof value !== 'string') {
286
+ return undefined;
287
+ }
288
+ const trimmed = value.trim();
289
+ return trimmed.length ? trimmed : undefined;
290
+ }
291
+ // Shared id precedence. Kept in one place (rather than once per request shape)
292
+ // so the header-name contract documented above is only spelled out once.
293
+ function seedIds(read) {
294
+ var _a, _b, _c, _d;
295
+ const requestId = (_b = (_a = read('x-request-id')) !== null && _a !== void 0 ? _a : read('request-id')) !== null && _b !== void 0 ? _b : generateId();
296
+ const correlationId = (_d = (_c = read('x-correlation-id')) !== null && _c !== void 0 ? _c : read('x-amzn-trace-id')) !== null && _d !== void 0 ? _d : requestId;
297
+ return { request_id: requestId, correlation_id: correlationId };
298
+ }
299
+ // App Router / middleware: headers are a web `Headers` instance.
300
+ function seedRequestEventContext(headers) {
301
+ return seedIds((name) => readHeader(headers, name));
302
+ }
303
+ // Pages Router: headers are a Node bag (Pages routes are Node-only, never edge).
304
+ function seedNodeRequestEventContext(headers) {
305
+ return seedIds((name) => readNodeHeader(headers, name));
306
+ }
307
+ function now() {
308
+ return typeof performance !== 'undefined' ? performance.now() : Date.now();
309
+ }
310
+ // Mirrors Util.resolveInsights from @honeybadger-io/core: the master gate and
311
+ // the per-source flag must both be on.
312
+ function insightsHttpEnabled() {
313
+ const insights = Honeybadger__default["default"].config.insights;
314
+ return (insights === null || insights === void 0 ? void 0 : insights.enabled) === true && (insights === null || insights === void 0 ? void 0 : insights.http) === true;
315
+ }
316
+ // The ids are embedded directly in the payload (instead of relying on the
317
+ // store's eventContext merge) so the event carries them even on the edge
318
+ // runtime, where there is no per-request store isolation. On the Node.js
319
+ // runtime they match the seeded event context, so embedding is a no-op.
320
+ function emitHandledEvent(method, path, status, start, ids) {
321
+ const payload = {
322
+ method,
323
+ duration: Math.round(now() - start),
324
+ ...ids,
325
+ };
326
+ if (typeof path === 'string') {
327
+ payload.path = path;
328
+ }
329
+ if (typeof status === 'number') {
330
+ payload.status = status;
331
+ }
332
+ Honeybadger__default["default"].event('request.handled', payload);
333
+ }
334
+ // App Router / middleware: `req.url` is absolute, so parse out the pathname.
335
+ function emitRequestEvent(req, status, start, ids) {
336
+ let path;
337
+ try {
338
+ path = new URL(req.url).pathname;
339
+ }
340
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
341
+ catch (error) {
342
+ // relative or malformed URL — leave path unset
343
+ }
344
+ emitHandledEvent(req.method, path, status, start, ids);
345
+ }
346
+ // Pages Router: `req.url` is a relative path that may carry a query string.
347
+ function emitNodeRequestEvent(req, status, start, ids) {
348
+ const path = typeof req.url === 'string' ? req.url.split('?')[0] : undefined;
349
+ emitHandledEvent(req.method, path, status, start, ids);
350
+ }
351
+
352
+ /**
353
+ * The `waitUntil` primitive the hosting platform injects per request. Next.js
354
+ * resolves `after()` through this same accessor, and it is the only channel
355
+ * available in Pages Router API routes, which are invoked as `(req, res)` with
356
+ * no context argument to read it from.
357
+ */
358
+ function requestContextWaitUntil() {
359
+ var _a, _b;
360
+ const context = globalThis[Symbol.for('@next/request-context')];
361
+ 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;
362
+ return typeof waitUntil === 'function' ? waitUntil : undefined;
363
+ }
364
+ /**
365
+ * Middleware receives a `NextFetchEvent` as its second argument. Duck-typed
366
+ * rather than `instanceof` so the edge bundle needs no runtime import, and
367
+ * bound because `waitUntil` is a class method that collects into the event.
368
+ */
369
+ function eventWaitUntil(event) {
370
+ const waitUntil = event === null || event === void 0 ? void 0 : event.waitUntil;
371
+ return typeof waitUntil === 'function' ? waitUntil.bind(event) : undefined;
372
+ }
373
+ /**
374
+ * Ensure Insights events are delivered before the serverless/edge runtime
375
+ * freezes, without delaying the response where the runtime lets us avoid it.
376
+ *
377
+ * In order of preference: Next.js `after()` (stable in 15.1, App Router only —
378
+ * it needs App Router request context, so Pages Router must not call it), then
379
+ * a `waitUntil` from the middleware event or the platform request context,
380
+ * then a blocking `flushAsync()` when the runtime offers neither. Blocking is
381
+ * correct in that last case: no `waitUntil` means nothing is going to freeze
382
+ * the invocation out from under us.
383
+ *
384
+ * Delivery failures are logged by the events worker and must not break the handler.
385
+ */
386
+ function scheduleFlush(options = {}) {
387
+ var _a;
388
+ const flush = () => Honeybadger__default["default"].flushAsync().catch(() => { });
389
+ if (options.useAfter) {
390
+ const after = nextServer__namespace.after;
391
+ if (typeof after === 'function') {
392
+ // Exported but still refusable: `after()` throws outside a supported
393
+ // context. Fall through to the remaining strategies rather than failing
394
+ // the request.
395
+ try {
396
+ after(flush);
397
+ return;
398
+ }
399
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
400
+ catch (error) {
401
+ // try waitUntil / blocking flush below
402
+ }
403
+ }
404
+ }
405
+ const waitUntil = (_a = options.waitUntil) !== null && _a !== void 0 ? _a : requestContextWaitUntil();
406
+ if (waitUntil) {
407
+ waitUntil(flush());
408
+ return;
409
+ }
410
+ return flush();
411
+ }
412
+ function configure(overrides) {
209
413
  var _a;
210
414
  if (((_a = Honeybadger__default["default"].config.apiKey) === null || _a === void 0 ? void 0 : _a.length) > 0) {
211
415
  return;
@@ -224,7 +428,8 @@ function configure() {
224
428
  apiKey: process.env.NEXT_PUBLIC_HONEYBADGER_API_KEY,
225
429
  environment: process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.VERCEL_ENV || process.env.NODE_ENV,
226
430
  revision: process.env.NEXT_PUBLIC_HONEYBADGER_REVISION,
227
- projectRoot: 'webpack://_N_E/./'
431
+ projectRoot: 'webpack://_N_E/./',
432
+ ...overrides,
228
433
  })
229
434
  .beforeNotify((notice) => {
230
435
  if (!projectRoot) {
@@ -239,20 +444,135 @@ function configure() {
239
444
  });
240
445
  }
241
446
  /**
242
- * Wraps a handler function with Honeybadger error reporting.
243
- * Use with Next.js API route handlers or middleware.
447
+ * Next.js uses thrown errors for control flow: `redirect()`, `notFound()`,
448
+ * `forbidden()` and `unauthorized()` all throw an error carrying a `digest`
449
+ * string (`NEXT_REDIRECT;...`, `NEXT_NOT_FOUND`, `NEXT_HTTP_ERROR_FALLBACK;...`).
450
+ * These are not real failures — the framework catches them upstream to produce
451
+ * the redirect/404/etc. — so we must let them propagate without reporting them,
452
+ * otherwise every redirect shows up as an error in Honeybadger.
453
+ *
454
+ * We match on the `NEXT_` prefix rather than an exhaustive list so that any
455
+ * present or future framework control-flow digest is covered. This is safe:
456
+ * genuine errors that React tags with a `digest` use an opaque hash, and other
457
+ * Next.js bailout signals (e.g. `BAILOUT_TO_CLIENT_SIDE_RENDERING`,
458
+ * `DYNAMIC_SERVER_USAGE`) are not `NEXT_`-prefixed, so neither is skipped.
459
+ */
460
+ function isNextControlFlowError(error) {
461
+ const digest = error === null || error === void 0 ? void 0 : error.digest;
462
+ return typeof digest === 'string' && digest.startsWith('NEXT_');
463
+ }
464
+ /**
465
+ * Detects a Pages Router API invocation: `(req, res)` where `res` is a Node
466
+ * `ServerResponse`. We branch on this structurally because — unlike an App
467
+ * Router route handler — there is no returned `Response` to read the status
468
+ * from; it lives on `res.statusCode`.
244
469
  */
245
- function withHoneybadger(handler) {
246
- configure();
470
+ function isPagesApiInvocation(args) {
471
+ const req = args[0];
472
+ const res = args[1];
473
+ return (!!req && typeof req.headers === 'object' && req.headers !== null &&
474
+ !!res && typeof res.statusCode === 'number' && typeof res.end === 'function');
475
+ }
476
+ /**
477
+ * App Router route handlers and middleware: a web `Request`/`NextRequest` in, a
478
+ * `Response`/`NextResponse` out. The status comes from the returned response.
479
+ *
480
+ * `waitUntil` is present for middleware (from its `NextFetchEvent`); route
481
+ * handlers get `{ params }` as their second argument and rely on `after()`.
482
+ */
483
+ async function handleAppRouterRequest(call, req, canIsolate, waitUntil) {
484
+ const ids = seedRequestEventContext(req.headers);
485
+ if (canIsolate) {
486
+ Honeybadger__default["default"].setEventContext(ids);
487
+ }
488
+ const start = insightsHttpEnabled() ? now() : null;
489
+ try {
490
+ const response = await call();
491
+ if (start !== null) {
492
+ emitRequestEvent(req, response === null || response === void 0 ? void 0 : response.status, start, ids);
493
+ await scheduleFlush({ useAfter: true, waitUntil });
494
+ }
495
+ return response;
496
+ }
497
+ catch (error) {
498
+ if (isNextControlFlowError(error)) {
499
+ throw error;
500
+ }
501
+ if (start !== null) {
502
+ emitRequestEvent(req, 500, start, ids);
503
+ await scheduleFlush({ useAfter: true, waitUntil });
504
+ }
505
+ await Honeybadger__default["default"].notifyAsync(error);
506
+ throw error;
507
+ }
508
+ }
509
+ /**
510
+ * Pages Router API routes: a Node `req`/`res` pair. The handler writes to `res`
511
+ * and returns nothing meaningful, so the final status is read from
512
+ * `res.statusCode` once it resolves.
513
+ */
514
+ async function handlePagesApiRequest(call, req, res, canIsolate) {
515
+ const ids = seedNodeRequestEventContext(req.headers);
516
+ if (canIsolate) {
517
+ Honeybadger__default["default"].setEventContext(ids);
518
+ }
519
+ const start = insightsHttpEnabled() ? now() : null;
520
+ try {
521
+ const result = await call();
522
+ if (start !== null) {
523
+ emitNodeRequestEvent(req, res.statusCode, start, ids);
524
+ // No after() here: Pages Router lacks the App Router request context it
525
+ // needs. scheduleFlush falls through to the platform waitUntil instead.
526
+ await scheduleFlush({ useAfter: false });
527
+ }
528
+ return result;
529
+ }
530
+ catch (error) {
531
+ if (isNextControlFlowError(error)) {
532
+ throw error;
533
+ }
534
+ if (start !== null) {
535
+ emitNodeRequestEvent(req, 500, start, ids);
536
+ await scheduleFlush({ useAfter: false });
537
+ }
538
+ await Honeybadger__default["default"].notifyAsync(error);
539
+ throw error;
540
+ }
541
+ }
542
+ /**
543
+ * Unrecognised invocation shape: still report errors, but emit no insights
544
+ * event since we can't reliably read the request.
545
+ */
546
+ async function handleUninstrumented(call) {
547
+ try {
548
+ return await call();
549
+ }
550
+ catch (error) {
551
+ if (isNextControlFlowError(error)) {
552
+ throw error;
553
+ }
554
+ await Honeybadger__default["default"].notifyAsync(error);
555
+ throw error;
556
+ }
557
+ }
558
+ function withHoneybadger(handler, config) {
559
+ configure(config);
247
560
  return new Proxy(handler, {
248
- apply: async (target, thisArg, args) => {
249
- try {
250
- return await Reflect.apply(target, thisArg, args);
251
- }
252
- catch (error) {
253
- await Honeybadger__default["default"].notifyAsync(error);
254
- throw error; // Re-throw the error after reporting it
255
- }
561
+ apply: (target, thisArg, args) => {
562
+ const canIsolate = typeof Honeybadger__default["default"].run === 'function';
563
+ const call = () => Reflect.apply(target, thisArg, args);
564
+ const invoke = () => {
565
+ // App Router / middleware first: a web Request as the first argument.
566
+ if (typeof Request !== 'undefined' && args[0] instanceof Request) {
567
+ return handleAppRouterRequest(call, args[0], canIsolate, eventWaitUntil(args[1]));
568
+ }
569
+ // Pages Router API route: a Node req/res pair.
570
+ if (isPagesApiInvocation(args)) {
571
+ return handlePagesApiRequest(call, args[0], args[1], canIsolate);
572
+ }
573
+ return handleUninstrumented(call);
574
+ };
575
+ return canIsolate ? Honeybadger__default["default"].run(invoke) : invoke();
256
576
  },
257
577
  });
258
578
  }
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-nextjs.cjs.js","sources":["../../build/webpack.js","../../build/with-honeybadger.js"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport HoneybadgerSourceMapPlugin from '@honeybadger-io/webpack';\nconst URL_DOCS_SOURCE_MAPS_UPLOAD = 'https://docs.honeybadger.io/lib/javascript/integration/nextjs/#source-map-upload-and-tracking-deploys';\nlet _silent = true;\nfunction log(type, msg) {\n if (['error', 'warn'].includes(type) || !_silent) {\n console[type]('[HoneybadgerNextJs]', msg);\n }\n}\nfunction shouldUploadSourceMaps(honeybadgerNextJsConfig, context) {\n const { dev } = context;\n if (honeybadgerNextJsConfig.disableSourceMapUpload) {\n return false;\n }\n if (!honeybadgerNextJsConfig.webpackPluginOptions || !honeybadgerNextJsConfig.webpackPluginOptions.apiKey) {\n log('warn', `skipping source map upload; here's how to enable: ${URL_DOCS_SOURCE_MAPS_UPLOAD}`);\n return false;\n }\n if (dev || process.env.NODE_ENV === 'development') {\n return false;\n }\n return true;\n}\nfunction mergeWithExistingWebpackConfig(nextJsWebpackConfig, honeybadgerNextJsConfig) {\n return function webpackFunctionMergedWithHb(webpackConfig, context) {\n const { isServer, dir: projectDir, nextRuntime } = context;\n const configType = isServer ? (nextRuntime === 'edge' ? 'edge' : 'server') : 'browser';\n log('debug', `reached webpackFunctionMergedWithHb isServer[${isServer}] configType[${configType}]`);\n let result = { ...webpackConfig };\n if (typeof nextJsWebpackConfig === 'function') {\n result = nextJsWebpackConfig(result, context);\n }\n const originalEntry = result.entry;\n result.entry = async () => injectHoneybadgerConfigToEntry(originalEntry, projectDir, configType);\n if (shouldUploadSourceMaps(honeybadgerNextJsConfig, context)) {\n // `result.devtool` must be 'hidden-source-map' or 'source-map' to properly pass sourcemaps.\n // Next.js uses regular `source-map` which doesnt pass its sourcemaps to Webpack.\n // https://github.com/vercel/next.js/blob/89ec21ed686dd79a5770b5c669abaff8f55d8fef/packages/next/build/webpack/config/blocks/base.ts#L40\n // Use the hidden-source-map option when you don't want the source maps to be\n // publicly available on the servers, only to the error reporting\n result.devtool = 'hidden-source-map';\n if (!result.plugins) {\n result.plugins = [];\n }\n const options = getWebpackPluginOptions(honeybadgerNextJsConfig);\n if (options) {\n result.plugins.push(new HoneybadgerSourceMapPlugin(options));\n }\n }\n return result;\n };\n}\nasync function injectHoneybadgerConfigToEntry(originalEntry, projectDir, configType) {\n const result = typeof originalEntry === 'function' ? await originalEntry() : { ...originalEntry };\n const hbConfigFile = getHoneybadgerConfigFile(projectDir, configType);\n if (!hbConfigFile) {\n return result;\n }\n const hbConfigFileRelativePath = `./${hbConfigFile}`;\n if (!Object.keys(result).length) {\n log('debug', `no entry points for configType[${configType}]`);\n }\n for (const entryName in result) {\n addHoneybadgerConfigToEntry(result, entryName, hbConfigFileRelativePath, configType);\n }\n return result;\n}\nfunction addHoneybadgerConfigToEntry(entry, entryName, hbConfigFile, configType) {\n log('debug', `adding entry[${entryName}] to configType[${configType}]`);\n switch (configType) {\n case 'server':\n if (!entryName.startsWith('pages/')) {\n return;\n }\n break;\n case 'browser':\n if (!['pages/_app', 'main-app'].includes(entryName)) {\n return;\n }\n break;\n case 'edge':\n // nothing?\n break;\n }\n const currentEntryPoint = entry[entryName];\n let newEntryPoint = currentEntryPoint;\n if (typeof currentEntryPoint === 'string') {\n newEntryPoint = [hbConfigFile, currentEntryPoint];\n }\n else if (Array.isArray(currentEntryPoint)) {\n newEntryPoint = [hbConfigFile, ...currentEntryPoint];\n } // descriptor object (webpack 5+)\n else if (typeof currentEntryPoint === 'object' && currentEntryPoint && 'import' in currentEntryPoint) {\n const currentImportValue = currentEntryPoint['import'];\n const newImportValue = [hbConfigFile];\n if (typeof currentImportValue === 'string') {\n newImportValue.push(currentImportValue);\n }\n else {\n newImportValue.push(...(currentImportValue));\n }\n newEntryPoint = {\n ...currentEntryPoint,\n import: newImportValue,\n };\n }\n else {\n log('error', 'Could not inject Honeybadger config to entry point: ' + JSON.stringify(currentEntryPoint, null, 2));\n }\n entry[entryName] = newEntryPoint;\n}\nfunction getHoneybadgerConfigFile(projectDir, configType) {\n const possibilities = [`honeybadger.${configType}.config.ts`, `honeybadger.${configType}.config.js`];\n for (const filename of possibilities) {\n if (fs.existsSync(path.resolve(projectDir, filename))) {\n return filename;\n }\n }\n log('debug', `could not find config file in ${projectDir} for ${configType}`);\n return null;\n}\nfunction getWebpackPluginOptions(honeybadgerNextJsConfig) {\n var _a, _b, _c;\n const apiKey = ((_a = honeybadgerNextJsConfig.webpackPluginOptions) === null || _a === void 0 ? void 0 : _a.apiKey) || process.env.NEXT_PUBLIC_HONEYBADGER_API_KEY;\n const assetsUrl = ((_b = honeybadgerNextJsConfig.webpackPluginOptions) === null || _b === void 0 ? void 0 : _b.assetsUrl) || process.env.NEXT_PUBLIC_HONEYBADGER_ASSETS_URL;\n if (!apiKey || !assetsUrl) {\n log('error', 'Missing Honeybadger required configuration for webpack plugin. Source maps will not be uploaded to Honeybadger.');\n return null;\n }\n return {\n ...honeybadgerNextJsConfig.webpackPluginOptions,\n apiKey,\n assetsUrl,\n revision: ((_c = honeybadgerNextJsConfig.webpackPluginOptions) === null || _c === void 0 ? void 0 : _c.revision) || process.env.NEXT_PUBLIC_HONEYBADGER_REVISION,\n silent: _silent,\n };\n}\nfunction getNextJsVersionInstalled() {\n var _a;\n try {\n return (_a = require('next/package.json').version) === null || _a === void 0 ? void 0 : _a.split('.');\n }\n catch (e) {\n return null;\n }\n}\n/**\n * NextJs will report a warning if the `serverExternalPackages` option is not present.\n * This is because @honeybadger-io/js will try to require configuration files dynamically (https://github.com/honeybadger-io/honeybadger-js/pull/1268).\n *\n * First reported here: https://github.com/honeybadger-io/honeybadger-js/issues/1351\n */\nfunction addServerExternalPackagesOption(config) {\n var _a, _b;\n // this should be available in the upcoming version of Next.js (14.3.0)\n if (config.serverExternalPackages && Array.isArray(config.serverExternalPackages)) {\n log('debug', 'adding @honeybadger-io/js to serverExternalPackages');\n config.serverExternalPackages.push('@honeybadger-io/js');\n return;\n }\n if (((_a = config.experimental) === null || _a === void 0 ? void 0 : _a.serverComponentsExternalPackages) && Array.isArray((_b = config.experimental) === null || _b === void 0 ? void 0 : _b.serverComponentsExternalPackages)) {\n log('debug', 'adding @honeybadger-io/js to experimental.serverComponentsExternalPackages');\n config.experimental.serverComponentsExternalPackages.push('@honeybadger-io/js');\n return;\n }\n const nextJsVersion = getNextJsVersionInstalled();\n if (nextJsVersion) {\n if ((+nextJsVersion[0] === 14 && +nextJsVersion[1] >= 3) || +nextJsVersion[0] > 14) {\n log('debug', 'adding serverExternalPackages option with value [\"@honeybadger-io/js\"]');\n config.serverExternalPackages = ['@honeybadger-io/js'];\n }\n else {\n log('debug', 'adding experimental.serverComponentsExternalPackages option with value [\"@honeybadger-io/js\"]');\n if (!config.experimental) {\n config.experimental = {};\n }\n config.experimental.serverComponentsExternalPackages = ['@honeybadger-io/js'];\n }\n }\n}\nexport function setupHoneybadger(config, honeybadgerNextJsConfig) {\n var _a;\n if (!honeybadgerNextJsConfig) {\n honeybadgerNextJsConfig = {\n silent: true,\n disableSourceMapUpload: false,\n };\n }\n _silent = (_a = honeybadgerNextJsConfig.silent) !== null && _a !== void 0 ? _a : true;\n addServerExternalPackagesOption(config);\n return {\n ...config,\n webpack: mergeWithExistingWebpackConfig(config.webpack, honeybadgerNextJsConfig)\n };\n}\n//# sourceMappingURL=webpack.js.map","import Honeybadger from '@honeybadger-io/js';\nfunction configure() {\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 })\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 * Wraps a handler function with Honeybadger error reporting.\n * Use with Next.js API route handlers or middleware.\n */\nexport function withHoneybadger(handler) {\n configure();\n return new Proxy(handler, {\n apply: async (target, thisArg, args) => {\n try {\n return await Reflect.apply(target, thisArg, args);\n }\n catch (error) {\n await Honeybadger.notifyAsync(error);\n throw error; // Re-throw the error after reporting it\n }\n },\n });\n}\n//# sourceMappingURL=with-honeybadger.js.map"],"names":["HoneybadgerSourceMapPlugin","fs","path","Honeybadger"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAM,2BAA2B,GAAG,uGAAuG,CAAC;AAC5I,IAAI,OAAO,GAAG,IAAI,CAAC;AACnB,SAAS,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE;AACxB,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACtD,QAAQ,OAAO,CAAC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OAAO,EAAE;AACzC,IAAI,SAAS,EAAE,CAAC;AAChB,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;AAC9B,QAAQ,KAAK,EAAE,OAAO,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK;AAChD,YAAY,IAAI;AAChB,gBAAgB,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAClE,aAAa;AACb,YAAY,OAAO,KAAK,EAAE;AAC1B,gBAAgB,MAAMA,+BAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrD,gBAAgB,MAAM,KAAK,CAAC;AAC5B,aAAa;AACb,SAAS;AACT,KAAK,CAAC,CAAC;AACP;;;;;"}
1
+ {"version":3,"file":"honeybadger-nextjs.cjs.js","sources":["../../build/webpack.js","../../build/insights-instrumentation.js","../../build/with-honeybadger.js"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport HoneybadgerSourceMapPlugin from '@honeybadger-io/webpack';\nconst URL_DOCS_SOURCE_MAPS_UPLOAD = 'https://docs.honeybadger.io/lib/javascript/integration/nextjs/#source-map-upload-and-tracking-deploys';\nlet _silent = true;\nfunction log(type, msg) {\n if (['error', 'warn'].includes(type) || !_silent) {\n console[type]('[HoneybadgerNextJs]', msg);\n }\n}\nfunction shouldUploadSourceMaps(honeybadgerNextJsConfig, context) {\n const { dev } = context;\n if (honeybadgerNextJsConfig.disableSourceMapUpload) {\n return false;\n }\n if (!honeybadgerNextJsConfig.webpackPluginOptions || !honeybadgerNextJsConfig.webpackPluginOptions.apiKey) {\n log('warn', `skipping source map upload; here's how to enable: ${URL_DOCS_SOURCE_MAPS_UPLOAD}`);\n return false;\n }\n if (dev || process.env.NODE_ENV === 'development') {\n return false;\n }\n return true;\n}\nfunction mergeWithExistingWebpackConfig(nextJsWebpackConfig, honeybadgerNextJsConfig) {\n return function webpackFunctionMergedWithHb(webpackConfig, context) {\n const { isServer, dir: projectDir, nextRuntime } = context;\n const configType = isServer ? (nextRuntime === 'edge' ? 'edge' : 'server') : 'browser';\n log('debug', `reached webpackFunctionMergedWithHb isServer[${isServer}] configType[${configType}]`);\n let result = { ...webpackConfig };\n if (typeof nextJsWebpackConfig === 'function') {\n result = nextJsWebpackConfig(result, context);\n }\n const originalEntry = result.entry;\n result.entry = async () => injectHoneybadgerConfigToEntry(originalEntry, projectDir, configType);\n if (shouldUploadSourceMaps(honeybadgerNextJsConfig, context)) {\n // `result.devtool` must be 'hidden-source-map' or 'source-map' to properly pass sourcemaps.\n // Next.js uses regular `source-map` which doesnt pass its sourcemaps to Webpack.\n // https://github.com/vercel/next.js/blob/89ec21ed686dd79a5770b5c669abaff8f55d8fef/packages/next/build/webpack/config/blocks/base.ts#L40\n // Use the hidden-source-map option when you don't want the source maps to be\n // publicly available on the servers, only to the error reporting\n result.devtool = 'hidden-source-map';\n if (!result.plugins) {\n result.plugins = [];\n }\n const options = getWebpackPluginOptions(honeybadgerNextJsConfig);\n if (options) {\n result.plugins.push(new HoneybadgerSourceMapPlugin(options));\n }\n }\n return result;\n };\n}\nasync function injectHoneybadgerConfigToEntry(originalEntry, projectDir, configType) {\n const result = typeof originalEntry === 'function' ? await originalEntry() : { ...originalEntry };\n const hbConfigFile = getHoneybadgerConfigFile(projectDir, configType);\n if (!hbConfigFile) {\n return result;\n }\n const hbConfigFileRelativePath = `./${hbConfigFile}`;\n if (!Object.keys(result).length) {\n log('debug', `no entry points for configType[${configType}]`);\n }\n for (const entryName in result) {\n addHoneybadgerConfigToEntry(result, entryName, hbConfigFileRelativePath, configType);\n }\n return result;\n}\nfunction addHoneybadgerConfigToEntry(entry, entryName, hbConfigFile, configType) {\n log('debug', `adding entry[${entryName}] to configType[${configType}]`);\n switch (configType) {\n case 'server':\n if (!entryName.startsWith('pages/')) {\n return;\n }\n break;\n case 'browser':\n if (!['pages/_app', 'main-app'].includes(entryName)) {\n return;\n }\n break;\n case 'edge':\n // nothing?\n break;\n }\n const currentEntryPoint = entry[entryName];\n let newEntryPoint = currentEntryPoint;\n if (typeof currentEntryPoint === 'string') {\n newEntryPoint = [hbConfigFile, currentEntryPoint];\n }\n else if (Array.isArray(currentEntryPoint)) {\n newEntryPoint = [hbConfigFile, ...currentEntryPoint];\n } // descriptor object (webpack 5+)\n else if (typeof currentEntryPoint === 'object' && currentEntryPoint && 'import' in currentEntryPoint) {\n const currentImportValue = currentEntryPoint['import'];\n const newImportValue = [hbConfigFile];\n if (typeof currentImportValue === 'string') {\n newImportValue.push(currentImportValue);\n }\n else {\n newImportValue.push(...(currentImportValue));\n }\n newEntryPoint = {\n ...currentEntryPoint,\n import: newImportValue,\n };\n }\n else {\n log('error', 'Could not inject Honeybadger config to entry point: ' + JSON.stringify(currentEntryPoint, null, 2));\n }\n entry[entryName] = newEntryPoint;\n}\nfunction getHoneybadgerConfigFile(projectDir, configType) {\n const possibilities = [`honeybadger.${configType}.config.ts`, `honeybadger.${configType}.config.js`];\n for (const filename of possibilities) {\n if (fs.existsSync(path.resolve(projectDir, filename))) {\n return filename;\n }\n }\n log('debug', `could not find config file in ${projectDir} for ${configType}`);\n return null;\n}\nfunction getWebpackPluginOptions(honeybadgerNextJsConfig) {\n var _a, _b, _c;\n const apiKey = ((_a = honeybadgerNextJsConfig.webpackPluginOptions) === null || _a === void 0 ? void 0 : _a.apiKey) || process.env.NEXT_PUBLIC_HONEYBADGER_API_KEY;\n const assetsUrl = ((_b = honeybadgerNextJsConfig.webpackPluginOptions) === null || _b === void 0 ? void 0 : _b.assetsUrl) || process.env.NEXT_PUBLIC_HONEYBADGER_ASSETS_URL;\n if (!apiKey || !assetsUrl) {\n log('error', 'Missing Honeybadger required configuration for webpack plugin. Source maps will not be uploaded to Honeybadger.');\n return null;\n }\n return {\n ...honeybadgerNextJsConfig.webpackPluginOptions,\n apiKey,\n assetsUrl,\n revision: ((_c = honeybadgerNextJsConfig.webpackPluginOptions) === null || _c === void 0 ? void 0 : _c.revision) || process.env.NEXT_PUBLIC_HONEYBADGER_REVISION,\n silent: _silent,\n };\n}\nfunction getNextJsVersionInstalled() {\n var _a;\n try {\n return (_a = require('next/package.json').version) === null || _a === void 0 ? void 0 : _a.split('.');\n }\n catch (e) {\n return null;\n }\n}\n/**\n * NextJs will report a warning if the `serverExternalPackages` option is not present.\n * This is because @honeybadger-io/js will try to require configuration files dynamically (https://github.com/honeybadger-io/honeybadger-js/pull/1268).\n *\n * First reported here: https://github.com/honeybadger-io/honeybadger-js/issues/1351\n */\nfunction addServerExternalPackagesOption(config) {\n var _a, _b;\n // this should be available in the upcoming version of Next.js (14.3.0)\n if (config.serverExternalPackages && Array.isArray(config.serverExternalPackages)) {\n log('debug', 'adding @honeybadger-io/js to serverExternalPackages');\n config.serverExternalPackages.push('@honeybadger-io/js');\n return;\n }\n if (((_a = config.experimental) === null || _a === void 0 ? void 0 : _a.serverComponentsExternalPackages) && Array.isArray((_b = config.experimental) === null || _b === void 0 ? void 0 : _b.serverComponentsExternalPackages)) {\n log('debug', 'adding @honeybadger-io/js to experimental.serverComponentsExternalPackages');\n config.experimental.serverComponentsExternalPackages.push('@honeybadger-io/js');\n return;\n }\n const nextJsVersion = getNextJsVersionInstalled();\n if (nextJsVersion) {\n if ((+nextJsVersion[0] === 14 && +nextJsVersion[1] >= 3) || +nextJsVersion[0] > 14) {\n log('debug', 'adding serverExternalPackages option with value [\"@honeybadger-io/js\"]');\n config.serverExternalPackages = ['@honeybadger-io/js'];\n }\n else {\n log('debug', 'adding experimental.serverComponentsExternalPackages option with value [\"@honeybadger-io/js\"]');\n if (!config.experimental) {\n config.experimental = {};\n }\n config.experimental.serverComponentsExternalPackages = ['@honeybadger-io/js'];\n }\n }\n}\nexport function setupHoneybadger(config, honeybadgerNextJsConfig) {\n var _a;\n if (!honeybadgerNextJsConfig) {\n honeybadgerNextJsConfig = {\n silent: true,\n disableSourceMapUpload: false,\n };\n }\n _silent = (_a = honeybadgerNextJsConfig.silent) !== null && _a !== void 0 ? _a : true;\n addServerExternalPackagesOption(config);\n return {\n ...config,\n webpack: mergeWithExistingWebpackConfig(config.webpack, honeybadgerNextJsConfig)\n };\n}\n//# sourceMappingURL=webpack.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 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":["HoneybadgerSourceMapPlugin","fs","path","Honeybadger","nextServer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,2BAA2B,GAAG,uGAAuG,CAAC;AAC5I,IAAI,OAAO,GAAG,IAAI,CAAC;AACnB,SAAS,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE;AACxB,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACtD,QAAQ,OAAO,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;AAClD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