@oxog/devinspector 1.2.0 → 1.3.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.
- package/CHANGELOG.md +36 -0
- package/LICENSE +0 -0
- package/README.md +85 -28
- package/dist/chunk-LNBLBFDA.js +92 -0
- package/dist/chunk-LNBLBFDA.js.map +1 -0
- package/dist/chunk-PPIEWSZ7.js +32 -0
- package/dist/chunk-PPIEWSZ7.js.map +1 -0
- package/dist/console-monitor-LBNXAQQ4.js +571 -0
- package/dist/console-monitor-LBNXAQQ4.js.map +1 -0
- package/dist/devinspector.umd.js +1782 -1074
- package/dist/devinspector.umd.js.map +1 -1
- package/dist/devinspector.umd.min.js +6 -1
- package/dist/devinspector.umd.min.js.map +1 -1
- package/dist/dom-monitor-IGQZTXMH.js +19 -0
- package/dist/dom-monitor-IGQZTXMH.js.map +1 -0
- package/dist/error-monitor-XDNRO4KS.js +423 -0
- package/dist/error-monitor-XDNRO4KS.js.map +1 -0
- package/dist/index.cjs +5918 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +582 -0
- package/dist/index.d.ts +582 -0
- package/dist/index.js +1983 -0
- package/dist/index.js.map +1 -0
- package/dist/inspector-ui-AFTUEVWA.js +1240 -0
- package/dist/inspector-ui-AFTUEVWA.js.map +1 -0
- package/dist/network-monitor-HUSRKEXE.js +841 -0
- package/dist/network-monitor-HUSRKEXE.js.map +1 -0
- package/dist/performance-monitor-66DQJGOJ.js +544 -0
- package/dist/performance-monitor-66DQJGOJ.js.map +1 -0
- package/dist/state-monitor-PS5Q7NWY.js +19 -0
- package/dist/state-monitor-PS5Q7NWY.js.map +1 -0
- package/dist/storage-monitor-QW634CEJ.js +19 -0
- package/dist/storage-monitor-QW634CEJ.js.map +1 -0
- package/package.json +51 -38
- package/dist/devinspector.cjs.js +0 -5494
- package/dist/devinspector.cjs.js.map +0 -1
- package/dist/devinspector.esm.js +0 -5482
- package/dist/devinspector.esm.js.map +0 -1
- package/dist/types/clean-inspector.d.ts +0 -52
- package/dist/types/core/event-emitter.d.ts +0 -21
- package/dist/types/core/inspector.d.ts +0 -121
- package/dist/types/core/plugin-system.d.ts +0 -60
- package/dist/types/core/storage.d.ts +0 -52
- package/dist/types/core/utils.d.ts +0 -34
- package/dist/types/enhanced-inspector.d.ts +0 -56
- package/dist/types/enhanced-simple.d.ts +0 -46
- package/dist/types/index-simple.d.ts +0 -11
- package/dist/types/index.d.ts +0 -19
- package/dist/types/monitors/console/console-interceptor.d.ts +0 -36
- package/dist/types/monitors/console/console-monitor.d.ts +0 -26
- package/dist/types/monitors/console/log-formatter.d.ts +0 -8
- package/dist/types/monitors/dom/dom-monitor.d.ts +0 -8
- package/dist/types/monitors/error/error-monitor.d.ts +0 -28
- package/dist/types/monitors/error/error-tracker.d.ts +0 -55
- package/dist/types/monitors/error/source-map-support.d.ts +0 -15
- package/dist/types/monitors/network/fetch-interceptor.d.ts +0 -45
- package/dist/types/monitors/network/network-monitor.d.ts +0 -47
- package/dist/types/monitors/network/websocket-monitor.d.ts +0 -44
- package/dist/types/monitors/network/xhr-interceptor.d.ts +0 -25
- package/dist/types/monitors/performance/fps-monitor.d.ts +0 -24
- package/dist/types/monitors/performance/long-task-detector.d.ts +0 -25
- package/dist/types/monitors/performance/memory-monitor.d.ts +0 -30
- package/dist/types/monitors/performance/metrics-collector.d.ts +0 -45
- package/dist/types/monitors/performance/performance-monitor.d.ts +0 -34
- package/dist/types/monitors/state/state-monitor.d.ts +0 -8
- package/dist/types/monitors/storage/storage-monitor.d.ts +0 -8
- package/dist/types/simple-index.d.ts +0 -3
- package/dist/types/simple-inspector.d.ts +0 -24
- package/dist/types/ui/components/floating-widget.d.ts +0 -21
- package/dist/types/ui/components/main-panel.d.ts +0 -38
- package/dist/types/ui/inspector-ui.d.ts +0 -29
- package/dist/types/ui/styles.d.ts +0 -1
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import {
|
|
2
|
+
generateId,
|
|
3
|
+
parseStackFrame
|
|
4
|
+
} from "./chunk-LNBLBFDA.js";
|
|
5
|
+
|
|
6
|
+
// src/monitors/error/error-tracker.ts
|
|
7
|
+
var ErrorTracker = class {
|
|
8
|
+
constructor(callback) {
|
|
9
|
+
this.groups = /* @__PURE__ */ new Map();
|
|
10
|
+
this.seenErrors = /* @__PURE__ */ new WeakSet();
|
|
11
|
+
this.ignorePatterns = [];
|
|
12
|
+
this.callback = callback;
|
|
13
|
+
this.setupDefaultIgnorePatterns();
|
|
14
|
+
}
|
|
15
|
+
setupDefaultIgnorePatterns() {
|
|
16
|
+
this.ignorePatterns = [
|
|
17
|
+
/ResizeObserver loop limit exceeded/,
|
|
18
|
+
/ResizeObserver loop completed with undelivered notifications/,
|
|
19
|
+
/Non-Error promise rejection captured/,
|
|
20
|
+
/Network request failed/,
|
|
21
|
+
/Failed to fetch/,
|
|
22
|
+
/Load failed/,
|
|
23
|
+
/Script error/
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
addIgnorePattern(pattern) {
|
|
27
|
+
this.ignorePatterns.push(pattern);
|
|
28
|
+
}
|
|
29
|
+
trackError(error, type = "error") {
|
|
30
|
+
if (error instanceof Error && this.seenErrors.has(error)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const errorInfo = this.createErrorInfo(error, type);
|
|
34
|
+
if (this.shouldIgnoreError(errorInfo)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (error instanceof Error) {
|
|
38
|
+
this.seenErrors.add(error);
|
|
39
|
+
}
|
|
40
|
+
const group = this.groupError(errorInfo);
|
|
41
|
+
errorInfo.groupId = group.id;
|
|
42
|
+
this.callback(errorInfo);
|
|
43
|
+
}
|
|
44
|
+
createErrorInfo(error, type) {
|
|
45
|
+
let message = "";
|
|
46
|
+
let stack = [];
|
|
47
|
+
let source;
|
|
48
|
+
let lineno;
|
|
49
|
+
let colno;
|
|
50
|
+
let errorObject;
|
|
51
|
+
if (error instanceof Error) {
|
|
52
|
+
message = error.message || error.toString();
|
|
53
|
+
stack = error.stack ? error.stack.split("\n").map((line) => line.trim()) : [];
|
|
54
|
+
errorObject = {
|
|
55
|
+
name: error.name,
|
|
56
|
+
message: error.message,
|
|
57
|
+
stack: error.stack
|
|
58
|
+
};
|
|
59
|
+
} else if ("message" in error && error instanceof ErrorEvent) {
|
|
60
|
+
message = error.message;
|
|
61
|
+
source = error.filename;
|
|
62
|
+
lineno = error.lineno;
|
|
63
|
+
colno = error.colno;
|
|
64
|
+
if (error.error) {
|
|
65
|
+
stack = error.error.stack ? error.error.stack.split("\n").map((line) => line.trim()) : [];
|
|
66
|
+
errorObject = error.error;
|
|
67
|
+
}
|
|
68
|
+
} else if ("reason" in error && error instanceof PromiseRejectionEvent) {
|
|
69
|
+
const reason = error.reason;
|
|
70
|
+
if (reason instanceof Error) {
|
|
71
|
+
message = reason.message || reason.toString();
|
|
72
|
+
stack = reason.stack ? reason.stack.split("\n").map((line) => line.trim()) : [];
|
|
73
|
+
errorObject = reason;
|
|
74
|
+
} else {
|
|
75
|
+
message = String(reason);
|
|
76
|
+
errorObject = reason;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const stackFrames = stack.map((frame) => parseStackFrame(frame)).filter((frame) => frame !== null);
|
|
80
|
+
const errorInfo = {
|
|
81
|
+
id: generateId(),
|
|
82
|
+
type,
|
|
83
|
+
message,
|
|
84
|
+
stack,
|
|
85
|
+
stackFrames,
|
|
86
|
+
source,
|
|
87
|
+
lineno,
|
|
88
|
+
colno,
|
|
89
|
+
timestamp: Date.now(),
|
|
90
|
+
userAgent: navigator.userAgent,
|
|
91
|
+
url: window.location.href,
|
|
92
|
+
errorObject,
|
|
93
|
+
count: 1
|
|
94
|
+
};
|
|
95
|
+
return errorInfo;
|
|
96
|
+
}
|
|
97
|
+
shouldIgnoreError(errorInfo) {
|
|
98
|
+
var _a;
|
|
99
|
+
for (const pattern of this.ignorePatterns) {
|
|
100
|
+
if (pattern.test(errorInfo.message)) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (errorInfo.message === "Script error." && !((_a = errorInfo.stack) == null ? void 0 : _a.length)) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
if (errorInfo.source && (errorInfo.source.includes("extension://") || errorInfo.source.includes("chrome-extension://") || errorInfo.source.includes("moz-extension://"))) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
groupError(errorInfo) {
|
|
113
|
+
const fingerprint = this.generateFingerprint(errorInfo);
|
|
114
|
+
let group = this.groups.get(fingerprint);
|
|
115
|
+
if (!group) {
|
|
116
|
+
group = {
|
|
117
|
+
id: generateId(),
|
|
118
|
+
fingerprint,
|
|
119
|
+
message: errorInfo.message,
|
|
120
|
+
count: 0,
|
|
121
|
+
firstSeen: errorInfo.timestamp,
|
|
122
|
+
lastSeen: errorInfo.timestamp,
|
|
123
|
+
errors: []
|
|
124
|
+
};
|
|
125
|
+
this.groups.set(fingerprint, group);
|
|
126
|
+
}
|
|
127
|
+
group.count++;
|
|
128
|
+
group.lastSeen = errorInfo.timestamp;
|
|
129
|
+
group.errors.push(errorInfo);
|
|
130
|
+
if (group.errors.length > 10) {
|
|
131
|
+
group.errors.shift();
|
|
132
|
+
}
|
|
133
|
+
return group;
|
|
134
|
+
}
|
|
135
|
+
generateFingerprint(errorInfo) {
|
|
136
|
+
const parts = [
|
|
137
|
+
errorInfo.type,
|
|
138
|
+
this.normalizeMessage(errorInfo.message)
|
|
139
|
+
];
|
|
140
|
+
if (errorInfo.stackFrames && errorInfo.stackFrames.length > 0) {
|
|
141
|
+
const topFrame = errorInfo.stackFrames[0];
|
|
142
|
+
if (topFrame.fileName) {
|
|
143
|
+
parts.push(topFrame.fileName);
|
|
144
|
+
if (topFrame.functionName) {
|
|
145
|
+
parts.push(topFrame.functionName);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
} else if (errorInfo.source) {
|
|
149
|
+
parts.push(errorInfo.source);
|
|
150
|
+
}
|
|
151
|
+
return parts.join("|");
|
|
152
|
+
}
|
|
153
|
+
normalizeMessage(message) {
|
|
154
|
+
return message.replace(/https?:\/\/[^\s]+/g, "<URL>").replace(/\b\d+\b/g, "<NUM>").replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, "<UUID>").replace(/"[^"]*"/g, '"<STRING>"').replace(/'[^']*'/g, "'<STRING>'").replace(/\s+/g, " ").trim();
|
|
155
|
+
}
|
|
156
|
+
getGroups() {
|
|
157
|
+
return Array.from(this.groups.values()).sort((a, b) => b.lastSeen - a.lastSeen);
|
|
158
|
+
}
|
|
159
|
+
getGroup(groupId) {
|
|
160
|
+
for (const group of this.groups.values()) {
|
|
161
|
+
if (group.id === groupId) {
|
|
162
|
+
return group;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return void 0;
|
|
166
|
+
}
|
|
167
|
+
clearGroups() {
|
|
168
|
+
this.groups.clear();
|
|
169
|
+
}
|
|
170
|
+
getErrorStats() {
|
|
171
|
+
let totalErrors = 0;
|
|
172
|
+
const errorsByType = {};
|
|
173
|
+
const recentErrors = [];
|
|
174
|
+
for (const group of this.groups.values()) {
|
|
175
|
+
totalErrors += group.count;
|
|
176
|
+
for (const error of group.errors) {
|
|
177
|
+
errorsByType[error.type] = (errorsByType[error.type] || 0) + 1;
|
|
178
|
+
recentErrors.push(error);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
recentErrors.sort((a, b) => b.timestamp - a.timestamp);
|
|
182
|
+
return {
|
|
183
|
+
totalErrors,
|
|
184
|
+
totalGroups: this.groups.size,
|
|
185
|
+
errorsByType,
|
|
186
|
+
recentErrors: recentErrors.slice(0, 10)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/monitors/error/source-map-support.ts
|
|
192
|
+
var SourceMapSupport = class {
|
|
193
|
+
constructor() {
|
|
194
|
+
this.cache = {};
|
|
195
|
+
this.enabled = true;
|
|
196
|
+
this.sourceMapUrlRegex = /\/\/# sourceMappingURL=(.+)$/;
|
|
197
|
+
this.checkSupport();
|
|
198
|
+
}
|
|
199
|
+
checkSupport() {
|
|
200
|
+
this.enabled = typeof fetch !== "undefined" && "URL" in window;
|
|
201
|
+
return this.enabled;
|
|
202
|
+
}
|
|
203
|
+
async enhanceStackTrace(stack) {
|
|
204
|
+
if (!this.enabled) return stack;
|
|
205
|
+
const enhancedStack = [];
|
|
206
|
+
for (const frame of stack) {
|
|
207
|
+
const enhanced = await this.enhanceStackFrame(frame);
|
|
208
|
+
enhancedStack.push(enhanced);
|
|
209
|
+
}
|
|
210
|
+
return enhancedStack;
|
|
211
|
+
}
|
|
212
|
+
async enhanceStackFrame(frame) {
|
|
213
|
+
const match = frame.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);
|
|
214
|
+
if (!match) return frame;
|
|
215
|
+
const [, functionName, fileUrl, line, column] = match;
|
|
216
|
+
const lineNumber = parseInt(line, 10);
|
|
217
|
+
const columnNumber = parseInt(column, 10);
|
|
218
|
+
try {
|
|
219
|
+
const sourceMapUrl = await this.findSourceMapUrl(fileUrl);
|
|
220
|
+
if (!sourceMapUrl) return frame;
|
|
221
|
+
const sourceMap = await this.loadSourceMap(fileUrl, sourceMapUrl);
|
|
222
|
+
if (!sourceMap) return frame;
|
|
223
|
+
const originalPosition = this.getOriginalPosition(
|
|
224
|
+
sourceMap,
|
|
225
|
+
lineNumber,
|
|
226
|
+
columnNumber
|
|
227
|
+
);
|
|
228
|
+
if (originalPosition) {
|
|
229
|
+
const functionPart = functionName ? `${functionName} ` : "";
|
|
230
|
+
return `at ${functionPart}(${originalPosition.source}:${originalPosition.line}:${originalPosition.column})`;
|
|
231
|
+
}
|
|
232
|
+
} catch (error) {
|
|
233
|
+
console.debug("Failed to enhance stack frame:", error);
|
|
234
|
+
}
|
|
235
|
+
return frame;
|
|
236
|
+
}
|
|
237
|
+
async findSourceMapUrl(fileUrl) {
|
|
238
|
+
if (this.cache[fileUrl]) {
|
|
239
|
+
return this.cache[fileUrl].sourceMapUrl;
|
|
240
|
+
}
|
|
241
|
+
try {
|
|
242
|
+
if (fileUrl.startsWith("data:") || fileUrl.includes("blob:")) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
const response = await fetch(fileUrl, {
|
|
246
|
+
method: "GET",
|
|
247
|
+
mode: "cors",
|
|
248
|
+
credentials: "omit"
|
|
249
|
+
});
|
|
250
|
+
if (!response.ok) return null;
|
|
251
|
+
const text = await response.text();
|
|
252
|
+
const lastLines = text.split("\n").slice(-5).join("\n");
|
|
253
|
+
const match = lastLines.match(this.sourceMapUrlRegex);
|
|
254
|
+
if (!match) return null;
|
|
255
|
+
const sourceMapUrl = match[1];
|
|
256
|
+
if (sourceMapUrl.startsWith("data:")) {
|
|
257
|
+
return sourceMapUrl;
|
|
258
|
+
}
|
|
259
|
+
const absoluteUrl = new URL(sourceMapUrl, fileUrl).href;
|
|
260
|
+
return absoluteUrl;
|
|
261
|
+
} catch (error) {
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
async loadSourceMap(fileUrl, sourceMapUrl) {
|
|
266
|
+
var _a;
|
|
267
|
+
if ((_a = this.cache[fileUrl]) == null ? void 0 : _a.sourceMap) {
|
|
268
|
+
return this.cache[fileUrl].sourceMap;
|
|
269
|
+
}
|
|
270
|
+
try {
|
|
271
|
+
let sourceMapData;
|
|
272
|
+
if (sourceMapUrl.startsWith("data:")) {
|
|
273
|
+
const base64 = sourceMapUrl.split(",")[1];
|
|
274
|
+
sourceMapData = atob(base64);
|
|
275
|
+
} else {
|
|
276
|
+
const response = await fetch(sourceMapUrl, {
|
|
277
|
+
method: "GET",
|
|
278
|
+
mode: "cors",
|
|
279
|
+
credentials: "omit"
|
|
280
|
+
});
|
|
281
|
+
if (!response.ok) return null;
|
|
282
|
+
sourceMapData = await response.text();
|
|
283
|
+
}
|
|
284
|
+
const sourceMap = JSON.parse(sourceMapData);
|
|
285
|
+
this.cache[fileUrl] = {
|
|
286
|
+
sourceMapUrl,
|
|
287
|
+
sourceMap
|
|
288
|
+
};
|
|
289
|
+
return sourceMap;
|
|
290
|
+
} catch (error) {
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
getOriginalPosition(sourceMap, line, column) {
|
|
295
|
+
var _a;
|
|
296
|
+
if (!sourceMap.mappings || !sourceMap.sources) {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
source: sourceMap.sources[0] || "unknown",
|
|
301
|
+
line,
|
|
302
|
+
column,
|
|
303
|
+
name: (_a = sourceMap.names) == null ? void 0 : _a[0]
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
clearCache() {
|
|
307
|
+
this.cache = {};
|
|
308
|
+
}
|
|
309
|
+
setEnabled(enabled) {
|
|
310
|
+
this.enabled = enabled && this.checkSupport();
|
|
311
|
+
}
|
|
312
|
+
isEnabled() {
|
|
313
|
+
return this.enabled;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// src/monitors/error/error-monitor.ts
|
|
318
|
+
var ErrorMonitor = class {
|
|
319
|
+
constructor(inspector) {
|
|
320
|
+
this.isActive = false;
|
|
321
|
+
this.originalHandlers = {
|
|
322
|
+
error: null,
|
|
323
|
+
unhandledrejection: null
|
|
324
|
+
};
|
|
325
|
+
this.handleErrorEvent = (event) => {
|
|
326
|
+
this.errorTracker.trackError(event, "error");
|
|
327
|
+
};
|
|
328
|
+
this.handleRejectionEvent = (event) => {
|
|
329
|
+
this.errorTracker.trackError(event, "unhandledRejection");
|
|
330
|
+
};
|
|
331
|
+
this.inspector = inspector;
|
|
332
|
+
this.errorTracker = new ErrorTracker(this.handleError.bind(this));
|
|
333
|
+
this.sourceMapSupport = new SourceMapSupport();
|
|
334
|
+
}
|
|
335
|
+
start() {
|
|
336
|
+
if (this.isActive) return;
|
|
337
|
+
this.installErrorHandlers();
|
|
338
|
+
this.isActive = true;
|
|
339
|
+
}
|
|
340
|
+
stop() {
|
|
341
|
+
if (!this.isActive) return;
|
|
342
|
+
this.uninstallErrorHandlers();
|
|
343
|
+
this.isActive = false;
|
|
344
|
+
}
|
|
345
|
+
installErrorHandlers() {
|
|
346
|
+
this.originalHandlers.error = window.onerror;
|
|
347
|
+
this.originalHandlers.unhandledrejection = window.onunhandledrejection;
|
|
348
|
+
window.onerror = (message, source, lineno, colno, error) => {
|
|
349
|
+
const errorEvent = new ErrorEvent("error", {
|
|
350
|
+
message: String(message),
|
|
351
|
+
filename: source,
|
|
352
|
+
lineno,
|
|
353
|
+
colno,
|
|
354
|
+
error
|
|
355
|
+
});
|
|
356
|
+
this.errorTracker.trackError(errorEvent, "error");
|
|
357
|
+
if (this.originalHandlers.error) {
|
|
358
|
+
return this.originalHandlers.error(message, source, lineno, colno, error);
|
|
359
|
+
}
|
|
360
|
+
return true;
|
|
361
|
+
};
|
|
362
|
+
window.onunhandledrejection = (event) => {
|
|
363
|
+
this.errorTracker.trackError(event, "unhandledRejection");
|
|
364
|
+
if (this.originalHandlers.unhandledrejection) {
|
|
365
|
+
return this.originalHandlers.unhandledrejection(event);
|
|
366
|
+
}
|
|
367
|
+
return true;
|
|
368
|
+
};
|
|
369
|
+
window.addEventListener("error", this.handleErrorEvent);
|
|
370
|
+
window.addEventListener("unhandledrejection", this.handleRejectionEvent);
|
|
371
|
+
}
|
|
372
|
+
uninstallErrorHandlers() {
|
|
373
|
+
window.onerror = this.originalHandlers.error;
|
|
374
|
+
window.onunhandledrejection = this.originalHandlers.unhandledrejection;
|
|
375
|
+
window.removeEventListener("error", this.handleErrorEvent);
|
|
376
|
+
window.removeEventListener("unhandledrejection", this.handleRejectionEvent);
|
|
377
|
+
}
|
|
378
|
+
async handleError(errorInfo) {
|
|
379
|
+
var _a, _b;
|
|
380
|
+
if (errorInfo.stack && this.sourceMapSupport.isEnabled()) {
|
|
381
|
+
try {
|
|
382
|
+
errorInfo.stack = await this.sourceMapSupport.enhanceStackTrace(errorInfo.stack);
|
|
383
|
+
} catch (error) {
|
|
384
|
+
console.debug("Failed to enhance stack trace:", error);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
const storage = this.inspector.getStorage("error");
|
|
388
|
+
storage.push(errorInfo);
|
|
389
|
+
this.inspector.getEvents().emit(
|
|
390
|
+
errorInfo.type === "unhandledRejection" ? "error:uncaught" : "error:caught",
|
|
391
|
+
errorInfo
|
|
392
|
+
);
|
|
393
|
+
(_b = (_a = this.inspector.getConfig()).onError) == null ? void 0 : _b.call(_a, new Error(errorInfo.message));
|
|
394
|
+
if (this.inspector.getConfig().enabled) {
|
|
395
|
+
console.error("[DevInspector] Error captured:", errorInfo);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// Public API
|
|
399
|
+
trackError(error) {
|
|
400
|
+
this.errorTracker.trackError(error);
|
|
401
|
+
}
|
|
402
|
+
getErrorGroups() {
|
|
403
|
+
return this.errorTracker.getGroups();
|
|
404
|
+
}
|
|
405
|
+
getErrorStats() {
|
|
406
|
+
return this.errorTracker.getErrorStats();
|
|
407
|
+
}
|
|
408
|
+
clearErrors() {
|
|
409
|
+
this.errorTracker.clearGroups();
|
|
410
|
+
const storage = this.inspector.getStorage("error");
|
|
411
|
+
storage.clear();
|
|
412
|
+
}
|
|
413
|
+
addIgnorePattern(pattern) {
|
|
414
|
+
this.errorTracker.addIgnorePattern(pattern);
|
|
415
|
+
}
|
|
416
|
+
enableSourceMaps(enabled) {
|
|
417
|
+
this.sourceMapSupport.setEnabled(enabled);
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
export {
|
|
421
|
+
ErrorMonitor
|
|
422
|
+
};
|
|
423
|
+
//# sourceMappingURL=error-monitor-XDNRO4KS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/monitors/error/error-tracker.ts","../src/monitors/error/source-map-support.ts","../src/monitors/error/error-monitor.ts"],"sourcesContent":["import { generateId, parseStackFrame } from '../../core/utils';\n\nexport interface ErrorInfo {\n id: string;\n type: 'error' | 'unhandledRejection';\n message: string;\n stack?: string[];\n stackFrames?: Array<{\n functionName?: string;\n fileName?: string;\n lineNumber?: number;\n columnNumber?: number;\n }>;\n source?: string;\n lineno?: number;\n colno?: number;\n timestamp: number;\n userAgent: string;\n url: string;\n errorObject?: any;\n groupId?: string;\n count: number;\n}\n\nexport interface ErrorGroup {\n id: string;\n fingerprint: string;\n message: string;\n count: number;\n firstSeen: number;\n lastSeen: number;\n errors: ErrorInfo[];\n}\n\nexport type ErrorCallback = (error: ErrorInfo) => void;\n\nexport class ErrorTracker {\n private callback: ErrorCallback;\n private groups: Map<string, ErrorGroup> = new Map();\n private seenErrors: WeakSet<Error> = new WeakSet();\n private ignorePatterns: RegExp[] = [];\n\n constructor(callback: ErrorCallback) {\n this.callback = callback;\n this.setupDefaultIgnorePatterns();\n }\n\n private setupDefaultIgnorePatterns(): void {\n this.ignorePatterns = [\n /ResizeObserver loop limit exceeded/,\n /ResizeObserver loop completed with undelivered notifications/,\n /Non-Error promise rejection captured/,\n /Network request failed/,\n /Failed to fetch/,\n /Load failed/,\n /Script error/\n ];\n }\n\n addIgnorePattern(pattern: RegExp): void {\n this.ignorePatterns.push(pattern);\n }\n\n trackError(error: Error | ErrorEvent | PromiseRejectionEvent, type: 'error' | 'unhandledRejection' = 'error'): void {\n // Avoid tracking the same error multiple times\n if (error instanceof Error && this.seenErrors.has(error)) {\n return;\n }\n\n const errorInfo = this.createErrorInfo(error, type);\n \n // Check if error should be ignored\n if (this.shouldIgnoreError(errorInfo)) {\n return;\n }\n\n // Mark error as seen\n if (error instanceof Error) {\n this.seenErrors.add(error);\n }\n\n // Group similar errors\n const group = this.groupError(errorInfo);\n errorInfo.groupId = group.id;\n\n this.callback(errorInfo);\n }\n\n private createErrorInfo(error: Error | ErrorEvent | PromiseRejectionEvent, type: 'error' | 'unhandledRejection'): ErrorInfo {\n let message = '';\n let stack: string[] = [];\n let source: string | undefined;\n let lineno: number | undefined;\n let colno: number | undefined;\n let errorObject: any;\n\n if (error instanceof Error) {\n message = error.message || error.toString();\n stack = error.stack ? error.stack.split('\\n').map(line => line.trim()) : [];\n errorObject = {\n name: error.name,\n message: error.message,\n stack: error.stack\n };\n } else if ('message' in error && error instanceof ErrorEvent) {\n message = error.message;\n source = error.filename;\n lineno = error.lineno;\n colno = error.colno;\n \n if (error.error) {\n stack = error.error.stack ? error.error.stack.split('\\n').map(line => line.trim()) : [];\n errorObject = error.error;\n }\n } else if ('reason' in error && error instanceof PromiseRejectionEvent) {\n const reason = error.reason;\n \n if (reason instanceof Error) {\n message = reason.message || reason.toString();\n stack = reason.stack ? reason.stack.split('\\n').map(line => line.trim()) : [];\n errorObject = reason;\n } else {\n message = String(reason);\n errorObject = reason;\n }\n }\n\n // Parse stack frames\n const stackFrames = stack\n .map(frame => parseStackFrame(frame))\n .filter(frame => frame !== null) as ErrorInfo['stackFrames'];\n\n const errorInfo: ErrorInfo = {\n id: generateId(),\n type,\n message,\n stack,\n stackFrames,\n source,\n lineno,\n colno,\n timestamp: Date.now(),\n userAgent: navigator.userAgent,\n url: window.location.href,\n errorObject,\n count: 1\n };\n\n return errorInfo;\n }\n\n private shouldIgnoreError(errorInfo: ErrorInfo): boolean {\n // Check ignore patterns\n for (const pattern of this.ignorePatterns) {\n if (pattern.test(errorInfo.message)) {\n return true;\n }\n }\n\n // Ignore cross-origin script errors without useful information\n if (errorInfo.message === 'Script error.' && !errorInfo.stack?.length) {\n return true;\n }\n\n // Ignore errors from browser extensions\n if (errorInfo.source && (\n errorInfo.source.includes('extension://') ||\n errorInfo.source.includes('chrome-extension://') ||\n errorInfo.source.includes('moz-extension://')\n )) {\n return true;\n }\n\n return false;\n }\n\n private groupError(errorInfo: ErrorInfo): ErrorGroup {\n const fingerprint = this.generateFingerprint(errorInfo);\n \n let group = this.groups.get(fingerprint);\n \n if (!group) {\n group = {\n id: generateId(),\n fingerprint,\n message: errorInfo.message,\n count: 0,\n firstSeen: errorInfo.timestamp,\n lastSeen: errorInfo.timestamp,\n errors: []\n };\n this.groups.set(fingerprint, group);\n }\n\n group.count++;\n group.lastSeen = errorInfo.timestamp;\n group.errors.push(errorInfo);\n\n // Keep only last 10 errors in each group\n if (group.errors.length > 10) {\n group.errors.shift();\n }\n\n return group;\n }\n\n private generateFingerprint(errorInfo: ErrorInfo): string {\n // Create a fingerprint based on error characteristics\n const parts: string[] = [\n errorInfo.type,\n this.normalizeMessage(errorInfo.message)\n ];\n\n // Add top stack frame if available\n if (errorInfo.stackFrames && errorInfo.stackFrames.length > 0) {\n const topFrame = errorInfo.stackFrames[0];\n if (topFrame.fileName) {\n parts.push(topFrame.fileName);\n if (topFrame.functionName) {\n parts.push(topFrame.functionName);\n }\n }\n } else if (errorInfo.source) {\n parts.push(errorInfo.source);\n }\n\n return parts.join('|');\n }\n\n private normalizeMessage(message: string): string {\n // Remove dynamic parts from error messages for better grouping\n return message\n // Remove URLs\n .replace(/https?:\\/\\/[^\\s]+/g, '<URL>')\n // Remove numbers\n .replace(/\\b\\d+\\b/g, '<NUM>')\n // Remove UUIDs\n .replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, '<UUID>')\n // Remove quotes content\n .replace(/\"[^\"]*\"/g, '\"<STRING>\"')\n .replace(/'[^']*'/g, \"'<STRING>'\")\n // Normalize whitespace\n .replace(/\\s+/g, ' ')\n .trim();\n }\n\n getGroups(): ErrorGroup[] {\n return Array.from(this.groups.values())\n .sort((a, b) => b.lastSeen - a.lastSeen);\n }\n\n getGroup(groupId: string): ErrorGroup | undefined {\n for (const group of this.groups.values()) {\n if (group.id === groupId) {\n return group;\n }\n }\n return undefined;\n }\n\n clearGroups(): void {\n this.groups.clear();\n }\n\n getErrorStats(): {\n totalErrors: number;\n totalGroups: number;\n errorsByType: Record<string, number>;\n recentErrors: ErrorInfo[];\n } {\n let totalErrors = 0;\n const errorsByType: Record<string, number> = {};\n const recentErrors: ErrorInfo[] = [];\n\n for (const group of this.groups.values()) {\n totalErrors += group.count;\n \n for (const error of group.errors) {\n errorsByType[error.type] = (errorsByType[error.type] || 0) + 1;\n recentErrors.push(error);\n }\n }\n\n // Sort by timestamp and take last 10\n recentErrors.sort((a, b) => b.timestamp - a.timestamp);\n\n return {\n totalErrors,\n totalGroups: this.groups.size,\n errorsByType,\n recentErrors: recentErrors.slice(0, 10)\n };\n }\n}","interface SourceMapPosition {\n source: string;\n line: number;\n column: number;\n name?: string;\n}\n\ninterface SourceMapCache {\n [url: string]: any;\n}\n\nexport class SourceMapSupport {\n private cache: SourceMapCache = {};\n private enabled: boolean = true;\n private sourceMapUrlRegex = /\\/\\/# sourceMappingURL=(.+)$/;\n\n constructor() {\n this.checkSupport();\n }\n\n private checkSupport(): boolean {\n // Check if we can fetch source maps\n this.enabled = typeof fetch !== 'undefined' && 'URL' in window;\n return this.enabled;\n }\n\n async enhanceStackTrace(stack: string[]): Promise<string[]> {\n if (!this.enabled) return stack;\n\n const enhancedStack: string[] = [];\n \n for (const frame of stack) {\n const enhanced = await this.enhanceStackFrame(frame);\n enhancedStack.push(enhanced);\n }\n\n return enhancedStack;\n }\n\n private async enhanceStackFrame(frame: string): Promise<string> {\n // Parse the stack frame\n const match = frame.match(/at\\s+(?:(.+?)\\s+\\()?(.+?):(\\d+):(\\d+)\\)?$/);\n \n if (!match) return frame;\n\n const [, functionName, fileUrl, line, column] = match;\n const lineNumber = parseInt(line, 10);\n const columnNumber = parseInt(column, 10);\n\n try {\n // Check if this is a local file or has source map\n const sourceMapUrl = await this.findSourceMapUrl(fileUrl);\n if (!sourceMapUrl) return frame;\n\n // Load and parse source map\n const sourceMap = await this.loadSourceMap(fileUrl, sourceMapUrl);\n if (!sourceMap) return frame;\n\n // Get original position\n const originalPosition = this.getOriginalPosition(\n sourceMap,\n lineNumber,\n columnNumber\n );\n\n if (originalPosition) {\n const functionPart = functionName ? `${functionName} ` : '';\n return `at ${functionPart}(${originalPosition.source}:${originalPosition.line}:${originalPosition.column})`;\n }\n } catch (error) {\n // Failed to enhance, return original frame\n console.debug('Failed to enhance stack frame:', error);\n }\n\n return frame;\n }\n\n private async findSourceMapUrl(fileUrl: string): Promise<string | null> {\n // Check cache first\n if (this.cache[fileUrl]) {\n return this.cache[fileUrl].sourceMapUrl;\n }\n\n try {\n // For inline source maps or data URLs, skip\n if (fileUrl.startsWith('data:') || fileUrl.includes('blob:')) {\n return null;\n }\n\n // Try to fetch the file to look for source map comment\n const response = await fetch(fileUrl, {\n method: 'GET',\n mode: 'cors',\n credentials: 'omit'\n });\n\n if (!response.ok) return null;\n\n const text = await response.text();\n const lastLines = text.split('\\n').slice(-5).join('\\n');\n \n const match = lastLines.match(this.sourceMapUrlRegex);\n if (!match) return null;\n\n const sourceMapUrl = match[1];\n \n // Handle relative URLs\n if (sourceMapUrl.startsWith('data:')) {\n return sourceMapUrl;\n }\n\n const absoluteUrl = new URL(sourceMapUrl, fileUrl).href;\n return absoluteUrl;\n } catch (error) {\n return null;\n }\n }\n\n private async loadSourceMap(fileUrl: string, sourceMapUrl: string): Promise<any> {\n // Check cache\n if (this.cache[fileUrl]?.sourceMap) {\n return this.cache[fileUrl].sourceMap;\n }\n\n try {\n let sourceMapData: string;\n\n if (sourceMapUrl.startsWith('data:')) {\n // Inline source map\n const base64 = sourceMapUrl.split(',')[1];\n sourceMapData = atob(base64);\n } else {\n // External source map\n const response = await fetch(sourceMapUrl, {\n method: 'GET',\n mode: 'cors',\n credentials: 'omit'\n });\n\n if (!response.ok) return null;\n sourceMapData = await response.text();\n }\n\n const sourceMap = JSON.parse(sourceMapData);\n \n // Cache it\n this.cache[fileUrl] = {\n sourceMapUrl,\n sourceMap\n };\n\n return sourceMap;\n } catch (error) {\n return null;\n }\n }\n\n private getOriginalPosition(\n sourceMap: any,\n line: number,\n column: number\n ): SourceMapPosition | null {\n // This is a simplified source map lookup\n // In a real implementation, you'd use a proper source map library\n \n if (!sourceMap.mappings || !sourceMap.sources) {\n return null;\n }\n\n // For now, return a simple mapping\n // Real implementation would decode VLQ mappings\n return {\n source: sourceMap.sources[0] || 'unknown',\n line: line,\n column: column,\n name: sourceMap.names?.[0]\n };\n }\n\n clearCache(): void {\n this.cache = {};\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled && this.checkSupport();\n }\n\n isEnabled(): boolean {\n return this.enabled;\n }\n}","import { DevInspector } from '../../core/inspector';\nimport { ErrorTracker, ErrorInfo } from './error-tracker';\nimport { SourceMapSupport } from './source-map-support';\n\nexport class ErrorMonitor {\n private inspector: DevInspector;\n private errorTracker: ErrorTracker;\n private sourceMapSupport: SourceMapSupport;\n private isActive: boolean = false;\n private originalHandlers: {\n error: OnErrorEventHandler | null;\n unhandledrejection: ((event: PromiseRejectionEvent) => any) | null;\n } = {\n error: null,\n unhandledrejection: null\n };\n\n constructor(inspector: DevInspector) {\n this.inspector = inspector;\n this.errorTracker = new ErrorTracker(this.handleError.bind(this));\n this.sourceMapSupport = new SourceMapSupport();\n }\n\n start(): void {\n if (this.isActive) return;\n \n this.installErrorHandlers();\n this.isActive = true;\n }\n\n stop(): void {\n if (!this.isActive) return;\n \n this.uninstallErrorHandlers();\n this.isActive = false;\n }\n\n private installErrorHandlers(): void {\n // Save original handlers\n this.originalHandlers.error = window.onerror;\n this.originalHandlers.unhandledrejection = window.onunhandledrejection;\n\n // Install error handler\n window.onerror = (message, source, lineno, colno, error) => {\n const errorEvent = new ErrorEvent('error', {\n message: String(message),\n filename: source,\n lineno,\n colno,\n error\n });\n\n this.errorTracker.trackError(errorEvent, 'error');\n\n // Call original handler if exists\n if (this.originalHandlers.error) {\n return this.originalHandlers.error(message, source, lineno, colno, error);\n }\n\n return true; // Prevent default browser error handling\n };\n\n // Install unhandled rejection handler\n window.onunhandledrejection = (event) => {\n this.errorTracker.trackError(event, 'unhandledRejection');\n\n // Call original handler if exists\n if (this.originalHandlers.unhandledrejection) {\n return this.originalHandlers.unhandledrejection(event);\n }\n\n return true; // Prevent default browser error handling\n };\n\n // Also use addEventListener for better coverage\n window.addEventListener('error', this.handleErrorEvent);\n window.addEventListener('unhandledrejection', this.handleRejectionEvent);\n }\n\n private uninstallErrorHandlers(): void {\n // Restore original handlers\n window.onerror = this.originalHandlers.error;\n window.onunhandledrejection = this.originalHandlers.unhandledrejection;\n\n // Remove event listeners\n window.removeEventListener('error', this.handleErrorEvent);\n window.removeEventListener('unhandledrejection', this.handleRejectionEvent);\n }\n\n private handleErrorEvent = (event: ErrorEvent): void => {\n this.errorTracker.trackError(event, 'error');\n };\n\n private handleRejectionEvent = (event: PromiseRejectionEvent): void => {\n this.errorTracker.trackError(event, 'unhandledRejection');\n };\n\n private async handleError(errorInfo: ErrorInfo): Promise<void> {\n // Enhance stack trace with source maps if available\n if (errorInfo.stack && this.sourceMapSupport.isEnabled()) {\n try {\n errorInfo.stack = await this.sourceMapSupport.enhanceStackTrace(errorInfo.stack);\n } catch (error) {\n console.debug('Failed to enhance stack trace:', error);\n }\n }\n\n // Store in circular buffer\n const storage = this.inspector.getStorage('error');\n storage.push(errorInfo);\n\n // Emit events\n this.inspector.getEvents().emit(\n errorInfo.type === 'unhandledRejection' ? 'error:uncaught' : 'error:caught',\n errorInfo\n );\n\n // Call error callback\n this.inspector.getConfig().onError?.(new Error(errorInfo.message));\n\n // Log to console in development\n if (this.inspector.getConfig().enabled) {\n console.error('[DevInspector] Error captured:', errorInfo);\n }\n }\n\n // Public API\n trackError(error: Error): void {\n this.errorTracker.trackError(error);\n }\n\n getErrorGroups() {\n return this.errorTracker.getGroups();\n }\n\n getErrorStats() {\n return this.errorTracker.getErrorStats();\n }\n\n clearErrors(): void {\n this.errorTracker.clearGroups();\n const storage = this.inspector.getStorage('error');\n storage.clear();\n }\n\n addIgnorePattern(pattern: RegExp): void {\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