@replayio-app-building/netlify-recorder 0.29.0 → 0.31.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.
Files changed (2) hide show
  1. package/dist/index.js +12 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -634,7 +634,14 @@ function createRecordingRequestHandler(handler, options) {
634
634
  );
635
635
  return responseWithHeader;
636
636
  }
637
- await finishRequest(reqContext, options.callbacks, response, finishOpts);
637
+ try {
638
+ await finishRequest(reqContext, options.callbacks, response, finishOpts);
639
+ } catch (err) {
640
+ console.error(
641
+ `netlify-recorder: finishRequest failed (handler: ${options.handlerPath ?? "unknown"})`,
642
+ err
643
+ );
644
+ }
638
645
  return responseWithHeader;
639
646
  };
640
647
  }
@@ -665,8 +672,8 @@ async function createRequestRecording(blobUrlOrData, handlerPath, requestInfo) {
665
672
  const g = globalThis;
666
673
  if (typeof g.Blob === "undefined") {
667
674
  try {
668
- const { Blob } = __require("buffer");
669
- g.Blob = Blob;
675
+ const { Blob: Blob2 } = __require("buffer");
676
+ g.Blob = Blob2;
670
677
  } catch {
671
678
  }
672
679
  }
@@ -1064,11 +1071,8 @@ async function uploadBlobData(blobData, requestId) {
1064
1071
  );
1065
1072
  }
1066
1073
  const utapi = new UTApi({ token });
1067
- const file = new File(
1068
- [blobData],
1069
- `blob-${requestId}.json`,
1070
- { type: "application/json" }
1071
- );
1074
+ const blob = new Blob([blobData], { type: "application/json" });
1075
+ const file = Object.assign(blob, { name: `blob-${requestId}.json` });
1072
1076
  const result = await utapi.uploadFiles(file);
1073
1077
  if (result.error || !result.data?.ufsUrl) {
1074
1078
  throw new Error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replayio-app-building/netlify-recorder",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "Capture and replay Netlify function executions as Replay recordings",
5
5
  "type": "module",
6
6
  "exports": {