@vercel/microfrontends 2.3.5 → 2.3.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @vercel/microfrontends
2
2
 
3
+ ## 2.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - e6deb57: Prevent the local development proxy from crashing on mid-stream upstream errors
8
+
9
+ The HTTPS fallback path piped the upstream (production) response to the client without attaching an error handler. When that upstream connection reset mid-stream — common when many requests fan out to a production fallback — the unhandled `error` event surfaced as an uncaught exception and crashed the proxy process. The upstream response and client request/response streams now have error handlers that tear down the affected request instead of throwing.
10
+
3
11
  ## 2.3.5
4
12
 
5
13
  ### Patch Changes
package/dist/bin/cli.cjs CHANGED
@@ -30,7 +30,7 @@ var import_commander = require("commander");
30
30
  // package.json
31
31
  var package_default = {
32
32
  name: "@vercel/microfrontends",
33
- version: "2.3.5",
33
+ version: "2.3.6",
34
34
  private: false,
35
35
  description: "Defines configuration and utilities for microfrontends development",
36
36
  keywords: [
@@ -2928,6 +2928,12 @@ var LocalProxy = class {
2928
2928
  }
2929
2929
  res.writeHead(realRes.statusCode || 200, realRes.headers);
2930
2930
  realRes.pipe(res, { end: true });
2931
+ realRes.on("error", (err) => {
2932
+ logger.error("Proxy upstream response error: ", err);
2933
+ if (!res.destroyed && !res.writableEnded) {
2934
+ res.destroy(err);
2935
+ }
2936
+ });
2931
2937
  });
2932
2938
  req.pipe(proxyReq);
2933
2939
  proxyReq.on("error", (err) => {
@@ -2943,6 +2949,13 @@ var LocalProxy = class {
2943
2949
  `Error proxying request for ${target.application} to ${hostname}:${port}${path7}`
2944
2950
  );
2945
2951
  });
2952
+ req.on("error", (err) => {
2953
+ logger.error("Proxy client request error: ", err);
2954
+ proxyReq.destroy(err);
2955
+ });
2956
+ res.on("error", () => {
2957
+ proxyReq.destroy();
2958
+ });
2946
2959
  } else {
2947
2960
  const headers = {};
2948
2961
  headers[MFE_LOCAL_PROXY_HEADER] = "1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/microfrontends",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "private": false,
5
5
  "description": "Defines configuration and utilities for microfrontends development",
6
6
  "keywords": [