@lark-apaas/devtool-kits 1.0.5-alpha.5 → 1.0.5

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/dist/index.js CHANGED
@@ -28576,9 +28576,9 @@ function injectErrorData(template, errorLogs, clientBasePath) {
28576
28576
  }
28577
28577
  __name(injectErrorData, "injectErrorData");
28578
28578
  function handleDevProxyError(err, req, res, options) {
28579
- const { logDir = path2.join(process.cwd(), "logs"), maxErrorLogs = 100, logFileName = "server.log", retryTimeout = 5e3, retryInterval = 500, target, clientBasePath = process.env.CLIENT_BASE_PATH || "/" } = options || {};
28579
+ const { logDir = path2.join(process.cwd(), "logs"), maxErrorLogs = 100, logFileName = "server.log", retryTimeout = 5e3, retryInterval = 500, target = `http://localhost:${process.env.SERVER_PORT || 3e3}`, clientBasePath = process.env.CLIENT_BASE_PATH || "/" } = options || {};
28580
28580
  const clientBasePathWithoutSlash = normalizeBasePath(clientBasePath);
28581
- console.error("[Proxy Error]:", err.message);
28581
+ console.error("[Proxy Error]:", err.message, clientBasePathWithoutSlash);
28582
28582
  if (res.headersSent) {
28583
28583
  console.error("[Proxy Error]: Headers already sent, cannot send error page");
28584
28584
  return;
@@ -28587,7 +28587,7 @@ function handleDevProxyError(err, req, res, options) {
28587
28587
  try {
28588
28588
  const isConnError = isConnectionError(err);
28589
28589
  const { logs: errorLogs, hasCompileError } = await readRecentErrorLogs(logDir, maxErrorLogs, logFileName);
28590
- if (isConnError && !hasCompileError && target) {
28590
+ if (isConnError && !hasCompileError) {
28591
28591
  console.log("[Proxy Error]: Connection error without compile errors, possibly server restarting...");
28592
28592
  try {
28593
28593
  new URL(target);