@remotion/bundler 3.0.0-lambda.297 → 3.0.0-lambda.332
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/error-overlay/entry-basic.js +13 -16
- package/dist/error-overlay/entry-basic.js.map +1 -1
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js +19 -8
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js.map +1 -1
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts +2 -2
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +5 -11
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -1
- package/dist/error-overlay/react-overlay/index.d.ts +1 -7
- package/dist/error-overlay/react-overlay/index.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/index.js +8 -35
- package/dist/error-overlay/react-overlay/index.js.map +1 -1
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +4 -5
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +25 -27
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts +1 -1
- package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js +5 -11
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +2 -17
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-source-map.js +4 -28
- package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts +2 -9
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js +7 -28
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/parser.d.ts +2 -13
- package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/parser.js +45 -11
- package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/path.d.ts +1 -1
- package/dist/error-overlay/react-overlay/utils/path.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/path.js +0 -18
- package/dist/error-overlay/react-overlay/utils/path.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +27 -24
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/stack-frame.js +21 -60
- package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +2 -12
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/unmapper.js +37 -71
- package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +5 -39
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts +5 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +62 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts +7 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +42 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +2 -2
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts +2 -4
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +24 -9
- package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +2 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +4 -4
- package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts +3 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +9 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.js.map +1 -0
- package/dist/get-latest-remotion-version.d.ts +2 -0
- package/dist/get-latest-remotion-version.d.ts.map +1 -0
- package/dist/get-latest-remotion-version.js +32 -0
- package/dist/get-latest-remotion-version.js.map +1 -0
- package/dist/get-package-manager.d.ts +9 -0
- package/dist/get-package-manager.d.ts.map +1 -0
- package/dist/get-package-manager.js +39 -0
- package/dist/get-package-manager.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/start-server.d.ts.map +1 -1
- package/dist/start-server.js +3 -3
- package/dist/start-server.js.map +1 -1
- package/dist/test/latest-remotion-version.test.d.ts +2 -0
- package/dist/test/latest-remotion-version.test.d.ts.map +1 -0
- package/dist/test/latest-remotion-version.test.js +7 -0
- package/dist/test/latest-remotion-version.test.js.map +1 -0
- package/dist/test/parse-module-not-found.test.d.ts +2 -0
- package/dist/test/parse-module-not-found.test.d.ts.map +1 -0
- package/dist/test/parse-module-not-found.test.js +18 -0
- package/dist/test/parse-module-not-found.test.js.map +1 -0
- package/dist/update-available.d.ts +2 -2
- package/dist/update-available.d.ts.map +1 -1
- package/dist/update-available.js +5 -11
- package/dist/update-available.js.map +1 -1
- package/package.json +3 -4
|
@@ -3,23 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const react_overlay_1 = require("./react-overlay");
|
|
4
4
|
const remotion_overlay_1 = require("./remotion-overlay");
|
|
5
5
|
const Overlay_1 = require("./remotion-overlay/Overlay");
|
|
6
|
-
(0, react_overlay_1.startReportingRuntimeErrors)({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
return window.location.reload();
|
|
14
|
-
}
|
|
15
|
-
(0, react_overlay_1.dismissErrors)();
|
|
16
|
-
(_a = Overlay_1.setErrorsRef.current) === null || _a === void 0 ? void 0 : _a.setErrors({
|
|
17
|
-
type: 'clear',
|
|
18
|
-
});
|
|
6
|
+
(0, react_overlay_1.startReportingRuntimeErrors)(() => {
|
|
7
|
+
if (module.hot) {
|
|
8
|
+
module.hot.addStatusHandler((status) => {
|
|
9
|
+
var _a;
|
|
10
|
+
if (status === 'apply') {
|
|
11
|
+
if ((0, react_overlay_1.shouldReload)()) {
|
|
12
|
+
return window.location.reload();
|
|
19
13
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
(_a = Overlay_1.setErrorsRef.current) === null || _a === void 0 ? void 0 : _a.setErrors({
|
|
15
|
+
type: 'clear',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
23
20
|
});
|
|
24
21
|
(0, remotion_overlay_1.mountRemotionOverlay)();
|
|
25
22
|
//# sourceMappingURL=entry-basic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-basic.js","sourceRoot":"","sources":["../../src/error-overlay/entry-basic.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"entry-basic.js","sourceRoot":"","sources":["../../src/error-overlay/entry-basic.ts"],"names":[],"mappings":";;AAAA,mDAA0E;AAC1E,yDAAwD;AACxD,wDAAwD;AAExD,IAAA,2CAA2B,EAAC,GAAG,EAAE;IAChC,IAAI,MAAM,CAAC,GAAG,EAAE;QACf,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE;;YACtC,IAAI,MAAM,KAAK,OAAO,EAAE;gBACvB,IAAI,IAAA,4BAAY,GAAE,EAAE;oBACnB,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;iBAChC;gBAED,MAAA,sBAAY,CAAC,OAAO,0CAAE,SAAS,CAAC;oBAC/B,IAAI,EAAE,OAAO;iBACb,CAAC,CAAC;aACH;QACF,CAAC,CAAC,CAAC;KACH;AACF,CAAC,CAAC,CAAC;AACH,IAAA,uCAAoB,GAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-error-to-react-stack.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/map-error-to-react-stack.ts"],"names":[],"mappings":"AAEA,oBAAY,aAAa,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAS,KAAK,KAAG,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"map-error-to-react-stack.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/map-error-to-react-stack.ts"],"names":[],"mappings":"AAEA,oBAAY,aAAa,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAS,KAAK,KAAG,aAAa,GAAG,IAoDtE,CAAC"}
|
|
@@ -7,7 +7,8 @@ const getLocationFromBuildError = (err) => {
|
|
|
7
7
|
if (!err.stack) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
|
-
if (!err.stack.startsWith('Error: Module build failed')
|
|
10
|
+
if (!err.stack.startsWith('Error: Module build failed') &&
|
|
11
|
+
!err.stack.startsWith('Error: Cannot find module')) {
|
|
11
12
|
return null;
|
|
12
13
|
}
|
|
13
14
|
const split = err.stack.split('\n');
|
|
@@ -16,18 +17,28 @@ const getLocationFromBuildError = (err) => {
|
|
|
16
17
|
if (s.startsWith('Error')) {
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
const matchWebpackOrEsbuild = s.match(/(.*):([0-9]+):([0-9]+): (.*)/);
|
|
21
|
+
if (matchWebpackOrEsbuild) {
|
|
22
|
+
return {
|
|
23
|
+
fileName: matchWebpackOrEsbuild[1],
|
|
24
|
+
lineNumber: Number(matchWebpackOrEsbuild[2]),
|
|
25
|
+
columnNumber: Number(matchWebpackOrEsbuild[3]),
|
|
26
|
+
message: matchWebpackOrEsbuild[4],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const matchMissingModule = s.match(/\s+at(.*)\s\((.*)\)/);
|
|
30
|
+
if (!matchMissingModule) {
|
|
20
31
|
return null;
|
|
21
32
|
}
|
|
22
|
-
|
|
23
|
-
if (!matchWebpackOrEsbuild) {
|
|
33
|
+
if (s.includes('webpackMissingModule')) {
|
|
24
34
|
return null;
|
|
25
35
|
}
|
|
36
|
+
const [, filename] = matchMissingModule;
|
|
26
37
|
return {
|
|
27
|
-
|
|
28
|
-
lineNumber:
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
columnNumber: 0,
|
|
39
|
+
lineNumber: 1,
|
|
40
|
+
message: split[0],
|
|
41
|
+
fileName: filename.trim(),
|
|
31
42
|
};
|
|
32
43
|
})
|
|
33
44
|
.filter(remotion_1.Internals.truthy)[0]) !== null && _a !== void 0 ? _a : null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-error-to-react-stack.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/map-error-to-react-stack.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAS5B,MAAM,yBAAyB,GAAG,CAAC,GAAU,EAAwB,EAAE;;IAC7E,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE;QACf,OAAO,IAAI,CAAC;KACZ;IAED,
|
|
1
|
+
{"version":3,"file":"map-error-to-react-stack.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/map-error-to-react-stack.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAS5B,MAAM,yBAAyB,GAAG,CAAC,GAAU,EAAwB,EAAE;;IAC7E,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE;QACf,OAAO,IAAI,CAAC;KACZ;IAED,IACC,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC;QACnD,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,EACjD;QACD,OAAO,IAAI,CAAC;KACZ;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEpC,OAAO,CACN,MAAA,KAAK;SACH,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACV,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC;SACZ;QAED,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAEtE,IAAI,qBAAqB,EAAE;YAC1B,OAAO;gBACN,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC;gBAClC,UAAU,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;gBAC5C,YAAY,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;gBAC9C,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;aACjC,CAAC;SACF;QAED,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC1D,IAAI,CAAC,kBAAkB,EAAE;YACxB,OAAO,IAAI,CAAC;SACZ;QAED,IAAI,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;YACvC,OAAO,IAAI,CAAC;SACZ;QAED,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,kBAAkB,CAAC;QAExC,OAAO;YACN,YAAY,EAAE,CAAC;YACf,UAAU,EAAE,CAAC;YACb,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;YACjB,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE;SACzB,CAAC;IACH,CAAC,CAAC;SACD,MAAM,CAAC,oBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,mCAAI,IAAI,CACrC,CAAC;AACH,CAAC,CAAC;AApDW,QAAA,yBAAyB,6BAoDpC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SymbolicatedStackFrame } from '../utils/stack-frame';
|
|
2
2
|
import { ErrorLocation } from './map-error-to-react-stack';
|
|
3
|
-
export declare const resolveFileSource: (location: ErrorLocation, contextLines: number) => Promise<
|
|
3
|
+
export declare const resolveFileSource: (location: ErrorLocation, contextLines: number) => Promise<SymbolicatedStackFrame>;
|
|
4
4
|
//# sourceMappingURL=resolve-file-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-file-source.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/resolve-file-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"resolve-file-source.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/resolve-file-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,aACnB,aAAa,gBACT,MAAM,KAClB,QAAQ,sBAAsB,CAiChC,CAAC"}
|
|
@@ -21,17 +21,11 @@ const resolveFileSource = async (location, contextLines) => {
|
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
23
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_originalFunctionName: null,
|
|
30
|
-
columnNumber: location.columnNumber,
|
|
31
|
-
fileName: location.fileName,
|
|
32
|
-
functionName: null,
|
|
33
|
-
getSource: () => lines.map((_, l) => l).join('\n'),
|
|
34
|
-
lineNumber: location.lineNumber,
|
|
24
|
+
originalColumnNumber: location.columnNumber,
|
|
25
|
+
originalFunctionName: null,
|
|
26
|
+
originalFileName: location.fileName,
|
|
27
|
+
originalLineNumber: location.lineNumber,
|
|
28
|
+
originalScriptCode: scriptCode,
|
|
35
29
|
};
|
|
36
30
|
};
|
|
37
31
|
exports.resolveFileSource = resolveFileSource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-file-source.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/resolve-file-source.ts"],"names":[],"mappings":";;;AAGO,MAAM,iBAAiB,GAAG,KAAK,EACrC,QAAuB,EACvB,YAAoB,
|
|
1
|
+
{"version":3,"file":"resolve-file-source.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/resolve-file-source.ts"],"names":[],"mappings":";;;AAGO,MAAM,iBAAiB,GAAG,KAAK,EACrC,QAAuB,EACvB,YAAoB,EACc,EAAE;IACpC,MAAM,GAAG,GAAG,MAAM,KAAK,CACtB,sBAAsB,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAC7D,CAAC;IACF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,IAAI;SAChB,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,MAAM,oBAAoB,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAqB,CAAC;IACtD,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAAE,EAAE;QAClC,OAAO,CACN,IAAI,CAAC,GAAG,CAAC,oBAAoB,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,YAAY,CACpE,CAAC;IACH,CAAC,CAAC,CAAC;IAEJ,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;QAC5C,OAAO;YACN,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,QAAQ,CAAC,UAAU,KAAK,GAAG;YACtC,UAAU,EAAE,GAAG;SACf,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACN,oBAAoB,EAAE,QAAQ,CAAC,YAAY;QAC3C,oBAAoB,EAAE,IAAI;QAC1B,gBAAgB,EAAE,QAAQ,CAAC,QAAQ;QACnC,kBAAkB,EAAE,QAAQ,CAAC,UAAU;QACvC,kBAAkB,EAAE,UAAU;KAC9B,CAAC;AACH,CAAC,CAAC;AApCW,QAAA,iBAAiB,qBAoC5B"}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
declare type RuntimeReportingOptions = {
|
|
2
|
-
onError: () => void;
|
|
3
|
-
filename?: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const dismissErrors: () => void;
|
|
6
1
|
export declare const shouldReload: () => boolean;
|
|
7
|
-
export declare function startReportingRuntimeErrors(
|
|
8
|
-
export {};
|
|
2
|
+
export declare function startReportingRuntimeErrors(onError: () => void): void;
|
|
9
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,eAExB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,IAAI,QAU9D"}
|
|
@@ -1,49 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startReportingRuntimeErrors = exports.shouldReload =
|
|
4
|
-
const
|
|
3
|
+
exports.startReportingRuntimeErrors = exports.shouldReload = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
5
|
const listen_to_runtime_errors_1 = require("./listen-to-runtime-errors");
|
|
6
6
|
let stopListeningToRuntimeErrors = null;
|
|
7
|
-
let currentRuntimeErrorRecords = [];
|
|
8
|
-
const dismissErrors = () => {
|
|
9
|
-
currentRuntimeErrorRecords = [];
|
|
10
|
-
};
|
|
11
|
-
exports.dismissErrors = dismissErrors;
|
|
12
7
|
const shouldReload = () => {
|
|
13
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
return !((_a = remotion_1.Internals.getPreviewDomElement()) === null || _a === void 0 ? void 0 : _a.hasChildNodes());
|
|
14
10
|
};
|
|
15
11
|
exports.shouldReload = shouldReload;
|
|
16
|
-
function startReportingRuntimeErrors(
|
|
12
|
+
function startReportingRuntimeErrors(onError) {
|
|
17
13
|
if (stopListeningToRuntimeErrors !== null) {
|
|
18
14
|
throw new Error('Already listening');
|
|
19
15
|
}
|
|
20
|
-
const handleRuntimeError = (
|
|
21
|
-
|
|
22
|
-
if (typeof opts.onError === 'function') {
|
|
23
|
-
opts.onError.call(null);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
finally {
|
|
27
|
-
if (currentRuntimeErrorRecords.some(({ error }) => error === errorRecord.error)) {
|
|
28
|
-
// Deduplicate identical errors.
|
|
29
|
-
// This fixes https://github.com/facebook/create-react-app/issues/3011.
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
currentRuntimeErrorRecords = currentRuntimeErrorRecords.concat([
|
|
33
|
-
errorRecord,
|
|
34
|
-
]);
|
|
35
|
-
update();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
16
|
+
const handleRuntimeError = () => {
|
|
17
|
+
onError();
|
|
38
18
|
};
|
|
39
|
-
|
|
40
|
-
var _a;
|
|
41
|
-
(_a = Overlay_1.setErrorsRef.current) === null || _a === void 0 ? void 0 : _a.setErrors({
|
|
42
|
-
type: 'errors',
|
|
43
|
-
errors: currentRuntimeErrorRecords,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
stopListeningToRuntimeErrors = (0, listen_to_runtime_errors_1.listenToRuntimeErrors)(handleRuntimeError(options), options.filename);
|
|
19
|
+
stopListeningToRuntimeErrors = (0, listen_to_runtime_errors_1.listenToRuntimeErrors)(handleRuntimeError);
|
|
47
20
|
}
|
|
48
21
|
exports.startReportingRuntimeErrors = startReportingRuntimeErrors;
|
|
49
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,yEAAiE;AAEjE,IAAI,4BAA4B,GAAwB,IAAI,CAAC;AAEtD,MAAM,YAAY,GAAG,GAAG,EAAE;;IAChC,OAAO,CAAC,CAAA,MAAA,oBAAS,CAAC,oBAAoB,EAAE,0CAAE,aAAa,EAAE,CAAA,CAAC;AAC3D,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF,SAAgB,2BAA2B,CAAC,OAAmB;IAC9D,IAAI,4BAA4B,KAAK,IAAI,EAAE;QAC1C,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACrC;IAED,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC/B,OAAO,EAAE,CAAC;IACX,CAAC,CAAC;IAEF,4BAA4B,GAAG,IAAA,gDAAqB,EAAC,kBAAkB,CAAC,CAAC;AAC1E,CAAC;AAVD,kEAUC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SymbolicatedStackFrame } from './utils/stack-frame';
|
|
2
2
|
export declare type ErrorRecord = {
|
|
3
3
|
error: Error;
|
|
4
|
-
unhandledRejection: boolean;
|
|
5
4
|
contextSize: number;
|
|
6
|
-
stackFrames:
|
|
7
|
-
type: 'exception' | 'syntax';
|
|
5
|
+
stackFrames: SymbolicatedStackFrame[];
|
|
8
6
|
};
|
|
9
|
-
export declare
|
|
7
|
+
export declare const getErrorRecord: (error: Error) => Promise<ErrorRecord | null>;
|
|
8
|
+
export declare function listenToRuntimeErrors(crash: () => void): () => void;
|
|
10
9
|
//# sourceMappingURL=listen-to-runtime-errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listen-to-runtime-errors.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/listen-to-runtime-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"listen-to-runtime-errors.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/listen-to-runtime-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAE3D,oBAAY,WAAW,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,sBAAsB,EAAE,CAAC;CACtC,CAAC;AAgCF,eAAO,MAAM,cAAc,UACnB,KAAK,KACV,QAAQ,WAAW,GAAG,IAAI,CAY5B,CAAC;AAQF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,IAAI,cAsCtD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listenToRuntimeErrors = void 0;
|
|
3
|
+
exports.listenToRuntimeErrors = exports.getErrorRecord = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
6
6
|
*
|
|
@@ -15,35 +15,34 @@ const format_warning_1 = require("./effects/format-warning");
|
|
|
15
15
|
const get_stack_frames_1 = require("./utils/get-stack-frames");
|
|
16
16
|
const Overlay_1 = require("../remotion-overlay/Overlay");
|
|
17
17
|
const CONTEXT_SIZE = 3;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type: 'symbolicating',
|
|
23
|
-
});
|
|
24
|
-
const { frames: stackFrames, type } = await (0, get_stack_frames_1.getStackFrames)(error, CONTEXT_SIZE);
|
|
25
|
-
if (stackFrames === null || stackFrames === undefined) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
crash({
|
|
29
|
-
error,
|
|
30
|
-
unhandledRejection,
|
|
31
|
-
contextSize: CONTEXT_SIZE,
|
|
32
|
-
stackFrames,
|
|
33
|
-
type,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
console.log('Could not get the stack frames of error:', e);
|
|
18
|
+
const getErrorRecord = async (error) => {
|
|
19
|
+
const stackFrames = await (0, get_stack_frames_1.getStackFrames)(error, CONTEXT_SIZE);
|
|
20
|
+
if (stackFrames === null || stackFrames === undefined) {
|
|
21
|
+
return null;
|
|
38
22
|
}
|
|
23
|
+
return {
|
|
24
|
+
error,
|
|
25
|
+
contextSize: CONTEXT_SIZE,
|
|
26
|
+
stackFrames,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.getErrorRecord = getErrorRecord;
|
|
30
|
+
const crashWithFrames = (crash) => async (error) => {
|
|
31
|
+
var _a;
|
|
32
|
+
(_a = Overlay_1.setErrorsRef.current) === null || _a === void 0 ? void 0 : _a.addError(error);
|
|
33
|
+
crash();
|
|
39
34
|
};
|
|
40
|
-
function listenToRuntimeErrors(crash
|
|
35
|
+
function listenToRuntimeErrors(crash) {
|
|
41
36
|
const crashWithFramesRunTime = crashWithFrames(crash);
|
|
42
37
|
(0, unhandled_error_1.register)(window, (error) => {
|
|
43
|
-
return crashWithFramesRunTime(
|
|
38
|
+
return crashWithFramesRunTime({
|
|
39
|
+
message: error.message,
|
|
40
|
+
stack: error.stack,
|
|
41
|
+
name: error.name,
|
|
42
|
+
});
|
|
44
43
|
});
|
|
45
44
|
(0, unhandled_rejection_1.register)(window, (error) => {
|
|
46
|
-
return crashWithFramesRunTime(error
|
|
45
|
+
return crashWithFramesRunTime(error);
|
|
47
46
|
});
|
|
48
47
|
(0, stack_trace_limit_1.register)();
|
|
49
48
|
(0, proxy_console_1.registerReactStack)();
|
|
@@ -54,12 +53,11 @@ function listenToRuntimeErrors(crash, filename) {
|
|
|
54
53
|
crashWithFramesRunTime({
|
|
55
54
|
message: data.message,
|
|
56
55
|
stack: data.stack,
|
|
57
|
-
__unmap_source: filename,
|
|
58
56
|
name: '',
|
|
59
|
-
}
|
|
57
|
+
});
|
|
60
58
|
}
|
|
61
59
|
if (d.type === 'build-error') {
|
|
62
|
-
crashWithFramesRunTime(d.error
|
|
60
|
+
crashWithFramesRunTime(d.error);
|
|
63
61
|
}
|
|
64
62
|
});
|
|
65
63
|
return function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listen-to-runtime-errors.js","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/listen-to-runtime-errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"listen-to-runtime-errors.js","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/listen-to-runtime-errors.ts"],"names":[],"mappings":";;;AAQA;;;;;GAKG;AAEH,+DAGmC;AACnC,uEAGuC;AACvC,mEAGqC;AACrC,2DAIiC;AACjC,6DAAwD;AACxD,+DAAwD;AACxD,yDAAyD;AAEzD,MAAM,YAAY,GAAG,CAAC,CAAC;AAEhB,MAAM,cAAc,GAAG,KAAK,EAClC,KAAY,EACkB,EAAE;IAChC,MAAM,WAAW,GAAG,MAAM,IAAA,iCAAc,EAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAE9D,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;QACtD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO;QACN,KAAK;QACL,WAAW,EAAE,YAAY;QACzB,WAAW;KACX,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,cAAc,kBAczB;AAEF,MAAM,eAAe,GAAG,CAAC,KAAiB,EAAE,EAAE,CAAC,KAAK,EAAE,KAAY,EAAE,EAAE;;IACrE,MAAA,sBAAY,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtC,KAAK,EAAE,CAAC;AACT,CAAC,CAAC;AAEF,SAAgB,qBAAqB,CAAC,KAAiB;IACtD,MAAM,sBAAsB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEtD,IAAA,0BAAa,EAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QAC/B,OAAO,sBAAsB,CAAC;YAC7B,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,IAAI;SAChB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,IAAA,8BAAe,EAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QACjC,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,IAAA,4BAAuB,GAAE,CAAC;IAC1B,IAAA,kCAAkB,GAAE,CAAC;IACrB,IAAA,iCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,IAAI,KAAK,eAAe,EAAE;YAC/B,MAAM,EAAC,OAAO,EAAE,MAAM,EAAC,GAAG,CAAC,CAAC;YAC5B,MAAM,IAAI,GAAG,IAAA,+BAAc,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAE7C,sBAAsB,CAAC;gBACtB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,EAAE;aACR,CAAC,CAAC;SACH;QAED,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7B,sBAAsB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAChC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO;QACN,IAAA,8BAAyB,GAAE,CAAC;QAC5B,IAAA,gCAAiB,EAAC,MAAM,CAAC,CAAC;QAC1B,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;QACxB,IAAA,oCAAoB,GAAE,CAAC;IACxB,CAAC,CAAC;AACH,CAAC;AAtCD,sDAsCC"}
|
|
@@ -11,5 +11,5 @@ import { ScriptLine } from './stack-frame';
|
|
|
11
11
|
* @param {number} count The number of lines you'd like for context.
|
|
12
12
|
* @param {string[] | string} lines The source code.
|
|
13
13
|
*/
|
|
14
|
-
export declare function getLinesAround(line: number, count: number, lines: string[]
|
|
14
|
+
export declare function getLinesAround(line: number, count: number, lines: string[]): ScriptLine[];
|
|
15
15
|
//# sourceMappingURL=get-lines-around.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-lines-around.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"get-lines-around.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EAAE,GACb,UAAU,EAAE,CAed"}
|
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getLinesAround = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
const stack_frame_1 = require("./stack-frame");
|
|
14
7
|
/**
|
|
15
8
|
*
|
|
16
9
|
* @param {number} line The line number to provide context around.
|
|
@@ -18,12 +11,13 @@ const stack_frame_1 = require("./stack-frame");
|
|
|
18
11
|
* @param {string[] | string} lines The source code.
|
|
19
12
|
*/
|
|
20
13
|
function getLinesAround(line, count, lines) {
|
|
21
|
-
if (typeof lines === 'string') {
|
|
22
|
-
lines = lines.split('\n');
|
|
23
|
-
}
|
|
24
14
|
const result = [];
|
|
25
15
|
for (let index = Math.max(0, line - 1 - count); index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
|
|
26
|
-
result.push(
|
|
16
|
+
result.push({
|
|
17
|
+
lineNumber: index + 1,
|
|
18
|
+
content: lines[index],
|
|
19
|
+
highlight: index === line - 1,
|
|
20
|
+
});
|
|
27
21
|
}
|
|
28
22
|
return result;
|
|
29
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-lines-around.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":";AAAA;;EAEE;;;
|
|
1
|
+
{"version":3,"file":"get-lines-around.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAWF;;;;;GAKG;AACH,SAAgB,cAAc,CAC7B,IAAY,EACZ,KAAa,EACb,KAAe;IAEf,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,KACC,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,EACzC,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,EACrD,EAAE,KAAK,EACN;QACD,MAAM,CAAC,IAAI,CAAC;YACX,UAAU,EAAE,KAAK,GAAG,CAAC;YACrB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC;YACrB,SAAS,EAAE,KAAK,KAAK,IAAI,GAAG,CAAC;SAC7B,CAAC,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAnBD,wCAmBC"}
|
|
@@ -10,7 +10,7 @@ import { SourceMapConsumer } from 'source-map';
|
|
|
10
10
|
*
|
|
11
11
|
* This exposes methods which will be indifferent to changes made in <code>{@link https://github.com/mozilla/source-map source-map}</code>.
|
|
12
12
|
*/
|
|
13
|
-
declare class SourceMap {
|
|
13
|
+
export declare class SourceMap {
|
|
14
14
|
__source_map: SourceMapConsumer;
|
|
15
15
|
constructor(sourceMap: SourceMapConsumer);
|
|
16
16
|
/**
|
|
@@ -23,22 +23,7 @@ declare class SourceMap {
|
|
|
23
23
|
line: number;
|
|
24
24
|
column: number;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
* Returns the generated code position for an original position.
|
|
28
|
-
* @param {string} source The source file of the original code position.
|
|
29
|
-
* @param {number} line The line of the original code position.
|
|
30
|
-
* @param {number} column The column of the original code position.
|
|
31
|
-
*/
|
|
32
|
-
getGeneratedPosition(source: string, line: number, column: number): {
|
|
33
|
-
line: number;
|
|
34
|
-
column: number;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Returns the code for a given source file name.
|
|
38
|
-
* @param {string} sourceName The name of the source file.
|
|
39
|
-
*/
|
|
40
|
-
getSource(sourceName: string): string;
|
|
41
|
-
getSources(): string[];
|
|
26
|
+
getSource(sourceName: string): string | null;
|
|
42
27
|
}
|
|
43
28
|
/**
|
|
44
29
|
* Returns an instance of <code>{@link SourceMap}</code> for a given fileUri and fileContents.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-source-map.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"get-source-map.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,qBAAa,SAAS;IACrB,YAAY,EAAE,iBAAiB,CAAC;gBAEpB,SAAS,EAAE,iBAAiB;IAIxC;;;;OAIG;IACH,mBAAmB,CAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACZ;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC;IAYjD,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAG5C;AA0BD;;;;GAIG;AACH,iBAAe,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,CAAC,CAqBpB;AAED,OAAO,EAAC,YAAY,EAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Source code adapted from https://github.com/facebook/create-react-app/tree/main/packages/react-error-overlay and refactored in Typescript. This file is MIT-licensed.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getSourceMap = void 0;
|
|
6
|
+
exports.getSourceMap = exports.SourceMap = void 0;
|
|
7
7
|
/* eslint-disable no-eq-null */
|
|
8
8
|
/* eslint-disable eqeqeq */
|
|
9
9
|
/**
|
|
@@ -34,35 +34,11 @@ class SourceMap {
|
|
|
34
34
|
});
|
|
35
35
|
return { line: l, column: c, source: s };
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Returns the generated code position for an original position.
|
|
39
|
-
* @param {string} source The source file of the original code position.
|
|
40
|
-
* @param {number} line The line of the original code position.
|
|
41
|
-
* @param {number} column The column of the original code position.
|
|
42
|
-
*/
|
|
43
|
-
getGeneratedPosition(source, line, column) {
|
|
44
|
-
const { line: l, column: c } = this.__source_map.generatedPositionFor({
|
|
45
|
-
source,
|
|
46
|
-
line,
|
|
47
|
-
column,
|
|
48
|
-
});
|
|
49
|
-
return {
|
|
50
|
-
line: l,
|
|
51
|
-
column: c,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Returns the code for a given source file name.
|
|
56
|
-
* @param {string} sourceName The name of the source file.
|
|
57
|
-
*/
|
|
58
37
|
getSource(sourceName) {
|
|
59
38
|
return this.__source_map.sourceContentFor(sourceName);
|
|
60
39
|
}
|
|
61
|
-
getSources() {
|
|
62
|
-
// @ts-expect-error
|
|
63
|
-
return this.__source_map.sources;
|
|
64
|
-
}
|
|
65
40
|
}
|
|
41
|
+
exports.SourceMap = SourceMap;
|
|
66
42
|
function extractSourceMapUrl(fileUri, fileContents) {
|
|
67
43
|
const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
|
|
68
44
|
let match = null;
|
|
@@ -94,12 +70,12 @@ async function getSourceMap(fileUri, fileContents) {
|
|
|
94
70
|
sm = sm.substring(match2[0].length);
|
|
95
71
|
sm = window.atob(sm);
|
|
96
72
|
sm = JSON.parse(sm);
|
|
97
|
-
return new SourceMap(
|
|
73
|
+
return new SourceMap(new source_map_1.SourceMapConsumer(sm));
|
|
98
74
|
}
|
|
99
75
|
const index = fileUri.lastIndexOf('/');
|
|
100
76
|
const url = fileUri.substring(0, index + 1) + sm;
|
|
101
77
|
const obj = await fetch(url).then((res) => res.json());
|
|
102
|
-
return new SourceMap(
|
|
78
|
+
return new SourceMap(new source_map_1.SourceMapConsumer(obj));
|
|
103
79
|
}
|
|
104
80
|
exports.getSourceMap = getSourceMap;
|
|
105
81
|
//# sourceMappingURL=get-source-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-source-map.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF,+BAA+B;AAC/B,2BAA2B;AAC3B;;;;;GAKG;AAEH,2CAA6C;AAE7C;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"get-source-map.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF,+BAA+B;AAC/B,2BAA2B;AAC3B;;;;;GAKG;AAEH,2CAA6C;AAE7C;;;;GAIG;AACH,MAAa,SAAS;IAGrB,YAAY,SAA4B;QACvC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAClB,IAAY,EACZ,MAAc;QAEd,MAAM,EACL,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,GACT,GAAG,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC;YACzC,IAAI;YACJ,MAAM;SACN,CAAC,CAAC;QACH,OAAO,EAAC,IAAI,EAAE,CAAW,EAAE,MAAM,EAAE,CAAW,EAAE,MAAM,EAAE,CAAW,EAAC,CAAC;IACtE,CAAC;IAED,SAAS,CAAC,UAAkB;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;CACD;AA9BD,8BA8BC;AAED,SAAS,mBAAmB,CAC3B,OAAe,EACf,YAAoB;IAEpB,MAAM,KAAK,GAAG,6CAA6C,CAAC;IAC5D,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,SAAS;QACR,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACtC,IAAI,IAAI,IAAI,IAAI,EAAE;YACjB,MAAM;SACN;QAED,KAAK,GAAG,IAAI,CAAC;KACb;IAED,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,CAAA,EAAE;QAChB,OAAO,OAAO,CAAC,MAAM,CACpB,IAAI,KAAK,CAAC,0CAA0C,OAAO,GAAG,CAAC,CAC/D,CAAC;KACF;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,YAAY,CAC1B,OAAe,EACf,YAAoB;IAEpB,IAAI,EAAE,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1D,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC9B,MAAM,MAAM,GAAG,8CAA8C,CAAC;QAC9D,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,EAAE;YACZ,MAAM,IAAI,KAAK,CACd,gEAAgE,CAChE,CAAC;SACF;QAED,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACpC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,OAAO,IAAI,SAAS,CAAC,IAAI,8BAAiB,CAAC,EAAE,CAAC,CAAC,CAAC;KAChD;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACjD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,OAAO,IAAI,SAAS,CAAC,IAAI,8BAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAEO,oCAAY"}
|
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
declare
|
|
9
|
-
__unmap_source?: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
declare function getStackFrames(error: UnmappedError, contextSize?: number): Promise<{
|
|
12
|
-
frames: StackFrame[] | null;
|
|
13
|
-
type: 'exception' | 'syntax';
|
|
14
|
-
}>;
|
|
15
|
-
export { getStackFrames };
|
|
7
|
+
import type { SymbolicatedStackFrame } from './stack-frame';
|
|
8
|
+
export declare const getStackFrames: (error: Error, contextSize: number) => Promise<SymbolicatedStackFrame[] | null>;
|
|
16
9
|
//# sourceMappingURL=get-stack-frames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stack-frames.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"get-stack-frames.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAI1D,eAAO,MAAM,cAAc,UACnB,KAAK,eACC,MAAM,KACjB,QAAQ,sBAAsB,EAAE,GAAG,IAAI,CAiBzC,CAAC"}
|
|
@@ -6,38 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getStackFrames = void 0;
|
|
7
7
|
const parser_1 = require("./parser");
|
|
8
8
|
const unmapper_1 = require("./unmapper");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
if (error.__unmap_source) {
|
|
13
|
-
return {
|
|
14
|
-
frames: await (0, unmapper_1.unmap)(error.__unmap_source, parsedFrames, contextSize),
|
|
15
|
-
type: 'exception',
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const location = (0, map_error_to_react_stack_1.getLocationFromBuildError)(error);
|
|
19
|
-
if (location === null) {
|
|
20
|
-
return { frames: [], type: 'exception' };
|
|
21
|
-
}
|
|
22
|
-
const frames = await (0, resolve_file_source_1.resolveFileSource)(location, contextSize);
|
|
23
|
-
return { frames: [frames], type: 'syntax' };
|
|
24
|
-
};
|
|
25
|
-
async function getStackFrames(error, contextSize = 3) {
|
|
26
|
-
const parsedFrames = (0, parser_1.parseError)(error);
|
|
27
|
-
const { frames: enhancedFrames, type } = await getEnhancedFrames(error, parsedFrames, contextSize);
|
|
9
|
+
const getStackFrames = async (error, contextSize) => {
|
|
10
|
+
const parsedFrames = await (0, parser_1.parseError)(error, contextSize);
|
|
11
|
+
const enhancedFrames = await (0, unmapper_1.unmap)(parsedFrames, contextSize);
|
|
28
12
|
if (enhancedFrames
|
|
29
|
-
.map((f) => f.
|
|
13
|
+
.map((f) => f.originalFileName)
|
|
30
14
|
.filter((f_1) => f_1 !== null &&
|
|
31
15
|
f_1 !== undefined &&
|
|
32
16
|
f_1.indexOf('node_modules') === -1).length === 0) {
|
|
33
|
-
return
|
|
17
|
+
return null;
|
|
34
18
|
}
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
frames: enhancedFrames.filter(({ functionName }) => functionName === null ||
|
|
38
|
-
functionName === undefined ||
|
|
39
|
-
functionName.indexOf('__stack_frame_overlay_proxy_console__') === -1),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
19
|
+
return enhancedFrames;
|
|
20
|
+
};
|
|
42
21
|
exports.getStackFrames = getStackFrames;
|
|
43
22
|
//# sourceMappingURL=get-stack-frames.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stack-frames.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAUF,qCAAoC;AACpC,yCAAiC;
|
|
1
|
+
{"version":3,"file":"get-stack-frames.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAUF,qCAAoC;AACpC,yCAAiC;AAE1B,MAAM,cAAc,GAAG,KAAK,EAClC,KAAY,EACZ,WAAmB,EACwB,EAAE;IAC7C,MAAM,YAAY,GAAG,MAAM,IAAA,mBAAU,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC1D,MAAM,cAAc,GAAG,MAAM,IAAA,gBAAK,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC9D,IACC,cAAc;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;SAC9B,MAAM,CACN,CAAC,GAAG,EAAE,EAAE,CACP,GAAG,KAAK,IAAI;QACZ,GAAG,KAAK,SAAS;QACjB,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CACnC,CAAC,MAAM,KAAK,CAAC,EACd;QACD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB"}
|