@impakers/debug 1.3.12 → 1.3.13

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/react.mjs CHANGED
@@ -2105,28 +2105,35 @@ async function getSourceMapUrlFromBundle(bundleUrl) {
2105
2105
  async function loadSourceMap(bundleUrl) {
2106
2106
  if (cache2.has(bundleUrl)) return cache2.get(bundleUrl) ?? null;
2107
2107
  if (failedUrls.has(bundleUrl)) return null;
2108
+ const debugLog = typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG;
2108
2109
  const directMapUrl = bundleUrl.endsWith(".map") ? bundleUrl : `${bundleUrl}.map`;
2109
2110
  try {
2110
2111
  const res = await fetch(directMapUrl, { cache: "force-cache" });
2112
+ if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch:", res.status, directMapUrl);
2111
2113
  if (res.ok) {
2112
2114
  const rawMap = await res.json();
2113
2115
  const traceMap = new AnyMap(rawMap);
2114
2116
  cache2.set(bundleUrl, traceMap);
2115
2117
  return traceMap;
2116
2118
  }
2117
- } catch {
2119
+ } catch (e) {
2120
+ if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch exception:", e);
2118
2121
  }
2122
+ if (debugLog) console.log("[impakers-debug] 2\uCC28 \uC2DC\uB3C4: JS\uC5D0\uC11C sourceMappingURL \uCD94\uCD9C...");
2119
2123
  const actualMapUrl = await getSourceMapUrlFromBundle(bundleUrl);
2124
+ if (debugLog) console.log("[impakers-debug] 2\uCC28 actualMapUrl:", actualMapUrl);
2120
2125
  if (actualMapUrl) {
2121
2126
  try {
2122
2127
  const res = await fetch(actualMapUrl, { cache: "force-cache" });
2128
+ if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch:", res.status, actualMapUrl);
2123
2129
  if (res.ok) {
2124
2130
  const rawMap = await res.json();
2125
2131
  const traceMap = new AnyMap(rawMap);
2126
2132
  cache2.set(bundleUrl, traceMap);
2127
2133
  return traceMap;
2128
2134
  }
2129
- } catch {
2135
+ } catch (e) {
2136
+ if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch exception:", e);
2130
2137
  }
2131
2138
  }
2132
2139
  failedUrls.add(bundleUrl);