@remotion/bundler 3.0.0-lambda.295 → 3.0.0-lambda.329
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
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import { StackFrame } from './stack-frame';
|
|
8
|
-
/**
|
|
9
|
-
* Turns an <code>Error</code>, or similar object, into a set of <code>StackFrame</code>s.
|
|
10
|
-
* @alias parse
|
|
11
|
-
*/
|
|
12
|
-
declare function parseError(error: Error | string | string[]): StackFrame[];
|
|
13
|
-
export { parseError };
|
|
1
|
+
import { SomeStackFrame } from './stack-frame';
|
|
2
|
+
export declare const parseError: (error: Error | string | string[], contextLines: number) => Promise<SomeStackFrame[]>;
|
|
14
3
|
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":"AAaA,OAAO,EAAiB,cAAc,EAAa,MAAM,eAAe,CAAC;AAkFzE,eAAO,MAAM,UAAU,UACf,KAAK,GAAG,MAAM,GAAG,MAAM,EAAE,gBAClB,MAAM,KAClB,QAAQ,cAAc,EAAE,CA4C1B,CAAC"}
|
|
@@ -10,6 +10,8 @@ exports.parseError = void 0;
|
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
+
const map_error_to_react_stack_1 = require("../effects/map-error-to-react-stack");
|
|
14
|
+
const resolve_file_source_1 = require("../effects/resolve-file-source");
|
|
13
15
|
const stack_frame_1 = require("./stack-frame");
|
|
14
16
|
const regexExtractLocation = /\(?(.+?)(?::(\d+))?(?::(\d+))?\)?$/;
|
|
15
17
|
function extractLocation(token) {
|
|
@@ -43,7 +45,13 @@ function parseStack(stack) {
|
|
|
43
45
|
if (!_last) {
|
|
44
46
|
throw new Error('could not get last');
|
|
45
47
|
}
|
|
46
|
-
|
|
48
|
+
const [_fileName, _lineNumber, _columnNumber] = extractLocation(_last);
|
|
49
|
+
return (0, stack_frame_1.makeStackFrame)({
|
|
50
|
+
functionName: _data.join('@') || (isEval ? 'eval' : null),
|
|
51
|
+
fileName: _fileName,
|
|
52
|
+
lineNumber: _lineNumber,
|
|
53
|
+
columnNumber: _columnNumber,
|
|
54
|
+
});
|
|
47
55
|
}
|
|
48
56
|
// Strip eval, we don't care about it
|
|
49
57
|
if (e.indexOf('(eval ') !== -1) {
|
|
@@ -57,28 +65,54 @@ function parseStack(stack) {
|
|
|
57
65
|
if (!last) {
|
|
58
66
|
throw new Error('could not get last');
|
|
59
67
|
}
|
|
60
|
-
|
|
68
|
+
const [fileName, lineNumber, columnNumber] = extractLocation(last);
|
|
69
|
+
return (0, stack_frame_1.makeStackFrame)({
|
|
70
|
+
functionName: data.join(' ') || null,
|
|
71
|
+
fileName,
|
|
72
|
+
lineNumber,
|
|
73
|
+
columnNumber,
|
|
74
|
+
});
|
|
61
75
|
});
|
|
62
76
|
return frames;
|
|
63
77
|
}
|
|
64
|
-
|
|
65
|
-
* Turns an <code>Error</code>, or similar object, into a set of <code>StackFrame</code>s.
|
|
66
|
-
* @alias parse
|
|
67
|
-
*/
|
|
68
|
-
function parseError(error) {
|
|
78
|
+
const parseError = async (error, contextLines) => {
|
|
69
79
|
if (error === null) {
|
|
70
80
|
throw new Error('You cannot pass a null object.');
|
|
71
81
|
}
|
|
72
82
|
if (typeof error === 'string') {
|
|
73
|
-
return parseStack(error.split('\n'))
|
|
83
|
+
return parseStack(error.split('\n')).map((frame) => {
|
|
84
|
+
return {
|
|
85
|
+
type: 'transpiled',
|
|
86
|
+
frame,
|
|
87
|
+
};
|
|
88
|
+
});
|
|
74
89
|
}
|
|
75
90
|
if (Array.isArray(error)) {
|
|
76
|
-
return parseStack(error)
|
|
91
|
+
return parseStack(error).map((frame) => {
|
|
92
|
+
return {
|
|
93
|
+
type: 'transpiled',
|
|
94
|
+
frame,
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const errorLocation = (0, map_error_to_react_stack_1.getLocationFromBuildError)(error);
|
|
99
|
+
if (errorLocation) {
|
|
100
|
+
return [
|
|
101
|
+
{
|
|
102
|
+
type: 'symbolicated',
|
|
103
|
+
frame: await (0, resolve_file_source_1.resolveFileSource)(errorLocation, contextLines),
|
|
104
|
+
},
|
|
105
|
+
];
|
|
77
106
|
}
|
|
78
107
|
if (typeof error.stack === 'string') {
|
|
79
|
-
return parseStack(error.stack.split('\n'))
|
|
108
|
+
return parseStack(error.stack.split('\n')).map((frame) => {
|
|
109
|
+
return {
|
|
110
|
+
type: 'transpiled',
|
|
111
|
+
frame,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
80
114
|
}
|
|
81
115
|
throw new Error('The error you provided does not contain a stack trace.');
|
|
82
|
-
}
|
|
116
|
+
};
|
|
83
117
|
exports.parseError = parseError;
|
|
84
118
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF;;;;;GAKG;AAEH,+
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF;;;;;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,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC3E,CAAC,CAAC;AA/CW,QAAA,UAAU,cA+CrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare function normalizeStringPosix(path: string, allowAboveRoot: boolean): string;
|
|
2
2
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/path.ts"],"names":[],"mappings":"AAIA,iBAAS,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,UAmElE"}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Source code adapted from https://github.com/browserify/path-browserify and refactored in Typescript. This file is MIT-licensed.
|
|
4
4
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.pathNormalize = void 0;
|
|
7
5
|
function normalizeStringPosix(path, allowAboveRoot) {
|
|
8
6
|
let res = '';
|
|
9
7
|
let lastSegmentLength = 0;
|
|
@@ -79,20 +77,4 @@ function normalizeStringPosix(path, allowAboveRoot) {
|
|
|
79
77
|
}
|
|
80
78
|
return res;
|
|
81
79
|
}
|
|
82
|
-
function pathNormalize(path) {
|
|
83
|
-
if (path.length === 0)
|
|
84
|
-
return '.';
|
|
85
|
-
const isAbsolute = path.charCodeAt(0) === 47; /* / */
|
|
86
|
-
const trailingSeparator = path.charCodeAt(path.length - 1) === 47; /* / */
|
|
87
|
-
// Normalize the path
|
|
88
|
-
path = normalizeStringPosix(path, !isAbsolute);
|
|
89
|
-
if (path.length === 0 && !isAbsolute)
|
|
90
|
-
path = '.';
|
|
91
|
-
if (path.length > 0 && trailingSeparator)
|
|
92
|
-
path += '/';
|
|
93
|
-
if (isAbsolute)
|
|
94
|
-
return '/' + path;
|
|
95
|
-
return path;
|
|
96
|
-
}
|
|
97
|
-
exports.pathNormalize = pathNormalize;
|
|
98
80
|
//# sourceMappingURL=path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/path.ts"],"names":[],"mappings":";AAAA;;EAEE
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/path.ts"],"names":[],"mappings":";AAAA;;EAEE;AAEF,SAAS,oBAAoB,CAAC,IAAY,EAAE,cAAuB;IAClE,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,iBAAiB,GAAG,CAAC,CAAC;IAC1B,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;IACnB,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,IAAI,CAAC;IACT,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACtC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM;YAAE,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;aAC1C,IAAI,IAAI,KAAK,EAAE,CAAC,OAAO;YAAE,MAAM;;YAC/B,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC;QACvB,IAAI,IAAI,KAAK,EAAE,CAAC,OAAO,EAAE;YACxB,IAAI,SAAS,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE;gBACtC,OAAO;aACP;iBAAM,IAAI,SAAS,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE;gBAC7C,IACC,GAAG,CAAC,MAAM,GAAG,CAAC;oBACd,iBAAiB,KAAK,CAAC;oBACvB,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC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,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;;oBACzD,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;gBACxC,iBAAiB,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;aACtC;YAED,SAAS,GAAG,CAAC,CAAC;YACd,IAAI,GAAG,CAAC,CAAC;SACT;aAAM,IAAI,IAAI,KAAK,EAAE,CAAC,OAAO,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE;YAC9C,EAAE,IAAI,CAAC;SACP;aAAM;YACN,IAAI,GAAG,CAAC,CAAC,CAAC;SACV;KACD;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -4,35 +4,38 @@
|
|
|
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
|
-
|
|
8
|
-
export declare class ScriptLine {
|
|
9
|
-
/** The line number of this line of source. */
|
|
7
|
+
export declare type ScriptLine = {
|
|
10
8
|
lineNumber: number;
|
|
11
|
-
/** The content (or value) of this line of source. */
|
|
12
9
|
content: string;
|
|
13
|
-
/** Whether or not this line should be highlighted. Particularly useful for error reporting with context. */
|
|
14
10
|
highlight: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
};
|
|
12
|
+
export declare type SymbolicatedStackFrame = {
|
|
13
|
+
originalFunctionName: string | null;
|
|
14
|
+
originalFileName: string | null;
|
|
15
|
+
originalLineNumber: number | null;
|
|
16
|
+
originalColumnNumber: number | null;
|
|
17
|
+
originalScriptCode: ScriptLine[] | null;
|
|
18
|
+
};
|
|
19
|
+
export declare type StackFrame = {
|
|
20
|
+
functionName: string | null;
|
|
21
|
+
fileName: string;
|
|
22
|
+
lineNumber: number;
|
|
23
|
+
columnNumber: number;
|
|
24
|
+
};
|
|
25
|
+
export declare type SomeStackFrame = {
|
|
26
|
+
type: 'symbolicated';
|
|
27
|
+
frame: SymbolicatedStackFrame;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'transpiled';
|
|
30
|
+
frame: StackFrame;
|
|
31
|
+
};
|
|
17
32
|
/**
|
|
18
33
|
* A representation of a stack frame.
|
|
19
34
|
*/
|
|
20
|
-
export declare
|
|
35
|
+
export declare const makeStackFrame: ({ functionName, fileName, lineNumber, columnNumber, }: {
|
|
21
36
|
functionName: string | null;
|
|
22
|
-
fileName: string
|
|
23
|
-
lineNumber: number
|
|
24
|
-
columnNumber: number
|
|
25
|
-
|
|
26
|
-
_originalFileName: string | null;
|
|
27
|
-
_originalLineNumber: number | null;
|
|
28
|
-
_originalColumnNumber: number | null;
|
|
29
|
-
_scriptCode: ScriptLine[] | null;
|
|
30
|
-
_originalScriptCode: ScriptLine[] | null;
|
|
31
|
-
constructor(functionName?: string | null, fileName?: string | null, lineNumber?: number | null, columnNumber?: number | null, scriptCode?: ScriptLine[] | null, sourceFunctionName?: string | null, sourceFileName?: string | null, sourceLineNumber?: number | null, sourceColumnNumber?: number | null, sourceScriptCode?: ScriptLine[] | null);
|
|
32
|
-
/**
|
|
33
|
-
* Returns the source of the frame.
|
|
34
|
-
* This contains the file name, line number, and column number when available.
|
|
35
|
-
*/
|
|
36
|
-
getSource(): string;
|
|
37
|
-
}
|
|
37
|
+
fileName: string;
|
|
38
|
+
lineNumber: number;
|
|
39
|
+
columnNumber: number;
|
|
40
|
+
}) => StackFrame;
|
|
38
41
|
//# sourceMappingURL=stack-frame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-frame.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,
|
|
1
|
+
{"version":3,"file":"stack-frame.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,oBAAY,UAAU,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACpC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,kBAAkB,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF,oBAAY,UAAU,GAAG;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,cAAc,GACvB;IACA,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,sBAAsB,CAAC;CAC7B,GACD;IACA,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;CACjB,CAAC;AAEL;;GAEG;AAEH,eAAO,MAAM,cAAc;kBAMZ,MAAM,GAAG,IAAI;cACjB,MAAM;gBACJ,MAAM;kBACJ,MAAM;MACjB,UAuBH,CAAC"}
|
|
@@ -3,69 +3,30 @@
|
|
|
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.
|
|
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
|
-
/** A container holding a script line. */
|
|
14
|
-
class ScriptLine {
|
|
15
|
-
constructor(lineNumber, content, highlight = false) {
|
|
16
|
-
this.lineNumber = lineNumber;
|
|
17
|
-
this.content = content;
|
|
18
|
-
this.highlight = highlight;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.ScriptLine = ScriptLine;
|
|
6
|
+
exports.makeStackFrame = void 0;
|
|
22
7
|
/**
|
|
23
8
|
* A representation of a stack frame.
|
|
24
9
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
29
|
-
functionName = functionName.slice('Object.'.length);
|
|
30
|
-
}
|
|
31
|
-
if (
|
|
32
|
-
// Chrome has a bug with inferring function.name:
|
|
33
|
-
// https://github.com/facebook/create-react-app/issues/2097
|
|
34
|
-
// Let's ignore a meaningless name we get for top-level modules.
|
|
35
|
-
functionName === 'friendlySyntaxErrorLabel' ||
|
|
36
|
-
functionName === 'exports.__esModule' ||
|
|
37
|
-
functionName === '<anonymous>' ||
|
|
38
|
-
!functionName) {
|
|
39
|
-
functionName = null;
|
|
40
|
-
}
|
|
41
|
-
this.functionName = functionName;
|
|
42
|
-
this.fileName = fileName;
|
|
43
|
-
this.lineNumber = lineNumber;
|
|
44
|
-
this.columnNumber = columnNumber;
|
|
45
|
-
this._originalFunctionName = sourceFunctionName;
|
|
46
|
-
this._originalFileName = sourceFileName;
|
|
47
|
-
this._originalLineNumber = sourceLineNumber;
|
|
48
|
-
this._originalColumnNumber = sourceColumnNumber;
|
|
49
|
-
this._scriptCode = scriptCode;
|
|
50
|
-
this._originalScriptCode = sourceScriptCode;
|
|
10
|
+
const makeStackFrame = ({ functionName, fileName, lineNumber, columnNumber, }) => {
|
|
11
|
+
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
12
|
+
functionName = functionName.slice('Object.'.length);
|
|
51
13
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (this.lineNumber !== null) {
|
|
62
|
-
str += this.lineNumber + ':';
|
|
63
|
-
}
|
|
64
|
-
if (this.columnNumber !== null) {
|
|
65
|
-
str += this.columnNumber + ':';
|
|
66
|
-
}
|
|
67
|
-
return str.slice(0, -1);
|
|
14
|
+
if (
|
|
15
|
+
// Chrome has a bug with inferring function.name:
|
|
16
|
+
// https://github.com/facebook/create-react-app/issues/2097
|
|
17
|
+
// Let's ignore a meaningless name we get for top-level modules.
|
|
18
|
+
functionName === 'friendlySyntaxErrorLabel' ||
|
|
19
|
+
functionName === 'exports.__esModule' ||
|
|
20
|
+
functionName === '<anonymous>' ||
|
|
21
|
+
!functionName) {
|
|
22
|
+
functionName = null;
|
|
68
23
|
}
|
|
69
|
-
|
|
70
|
-
|
|
24
|
+
return {
|
|
25
|
+
columnNumber,
|
|
26
|
+
fileName,
|
|
27
|
+
functionName,
|
|
28
|
+
lineNumber,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.makeStackFrame = makeStackFrame;
|
|
71
32
|
//# sourceMappingURL=stack-frame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-frame.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":";AAAA;;EAEE;;;
|
|
1
|
+
{"version":3,"file":"stack-frame.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAwCF;;GAEG;AAEI,MAAM,cAAc,GAAG,CAAC,EAC9B,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,YAAY,GAMZ,EAAc,EAAE;IAChB,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QAC1D,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;KACpD;IAED;IACC,iDAAiD;IACjD,2DAA2D;IAC3D,gEAAgE;IAChE,YAAY,KAAK,0BAA0B;QAC3C,YAAY,KAAK,oBAAoB;QACrC,YAAY,KAAK,aAAa;QAC9B,CAAC,YAAY,EACZ;QACD,YAAY,GAAG,IAAI,CAAC;KACpB;IAED,OAAO;QACN,YAAY;QACZ,QAAQ;QACR,YAAY;QACZ,UAAU;KACV,CAAC;AACH,CAAC,CAAC;AAjCW,QAAA,cAAc,kBAiCzB"}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Turns a set of mapped <code>StackFrame</code>s back into their generated code position and enhances them with code.
|
|
4
|
-
* @param {string} fileUri The URI of the <code>bundle.js</code> file.
|
|
5
|
-
* @param {StackFrame[]} frames A set of <code>StackFrame</code>s which are already mapped and missing their generated positions.
|
|
6
|
-
* @param {number} [fileContents=3] The number of lines to provide before and after the line specified in the <code>StackFrame</code>.
|
|
7
|
-
*/
|
|
8
|
-
declare function unmap(_fileUri: string | {
|
|
9
|
-
uri: string;
|
|
10
|
-
contents: string;
|
|
11
|
-
}, frames: StackFrame[], contextLines: number): Promise<StackFrame[]>;
|
|
12
|
-
export { unmap };
|
|
1
|
+
import { SomeStackFrame, SymbolicatedStackFrame } from './stack-frame';
|
|
2
|
+
export declare const unmap: (frames: SomeStackFrame[], contextLines: number) => Promise<SymbolicatedStackFrame[]>;
|
|
13
3
|
//# sourceMappingURL=unmapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unmapper.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/unmapper.ts"],"names":[],"mappings":"AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"unmapper.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/unmapper.ts"],"names":[],"mappings":"AAgBA,OAAO,EACN,cAAc,EAEd,sBAAsB,EACtB,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,KAAK,WACT,cAAc,EAAE,gBACV,MAAM,KAClB,QAAQ,sBAAsB,EAAE,CA2ClC,CAAC"}
|
|
@@ -12,82 +12,48 @@ exports.unmap = void 0;
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
+
const remotion_1 = require("remotion");
|
|
15
16
|
const get_lines_around_1 = require("./get-lines-around");
|
|
16
17
|
const get_source_map_1 = require("./get-source-map");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* @param {number} [fileContents=3] The number of lines to provide before and after the line specified in the <code>StackFrame</code>.
|
|
37
|
-
*/
|
|
38
|
-
async function unmap(_fileUri, frames, contextLines) {
|
|
39
|
-
let fileContents = typeof _fileUri === 'object' ? _fileUri.contents : null;
|
|
40
|
-
const fileUri = typeof _fileUri === 'object' ? _fileUri.uri : _fileUri;
|
|
41
|
-
if (fileContents == null) {
|
|
42
|
-
fileContents = await fetch(fileUri).then((res) => res.text());
|
|
18
|
+
const getFileContents = async (fileName) => {
|
|
19
|
+
const res = await fetch(fileName);
|
|
20
|
+
const fileContents = await res.text();
|
|
21
|
+
return fileContents;
|
|
22
|
+
};
|
|
23
|
+
const unmap = async (frames, contextLines) => {
|
|
24
|
+
const transpiled = frames
|
|
25
|
+
.filter((s) => s.type === 'transpiled')
|
|
26
|
+
.map((s) => s.frame);
|
|
27
|
+
const uniqueFileNames = [
|
|
28
|
+
...new Set(transpiled.map((f) => f.fileName).filter(remotion_1.Internals.truthy)),
|
|
29
|
+
];
|
|
30
|
+
const maps = await Promise.all(uniqueFileNames.map(async (fileName) => {
|
|
31
|
+
const fileContents = await getFileContents(fileName);
|
|
32
|
+
return (0, get_source_map_1.getSourceMap)(fileName, fileContents);
|
|
33
|
+
}));
|
|
34
|
+
const mapValues = {};
|
|
35
|
+
for (let i = 0; i < uniqueFileNames.length; i++) {
|
|
36
|
+
mapValues[uniqueFileNames[i]] = maps[i];
|
|
43
37
|
}
|
|
44
|
-
const map = await (0, get_source_map_1.getSourceMap)(fileUri, fileContents);
|
|
45
38
|
return frames.map((frame) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return frame;
|
|
49
|
-
}
|
|
50
|
-
let { fileName } = frame;
|
|
51
|
-
if (fileName) {
|
|
52
|
-
// The web version of this module only provides POSIX support, so Windows
|
|
53
|
-
// paths like C:\foo\\baz\..\\bar\ cannot be normalized.
|
|
54
|
-
// A simple solution to this is to replace all `\` with `/`, then
|
|
55
|
-
// normalize afterwards.
|
|
56
|
-
fileName = (0, path_1.pathNormalize)(fileName.replace(/[\\]+/g, '/'));
|
|
57
|
-
}
|
|
58
|
-
if (fileName == null) {
|
|
59
|
-
return frame;
|
|
60
|
-
}
|
|
61
|
-
const fN = fileName;
|
|
62
|
-
const source = map
|
|
63
|
-
.getSources()
|
|
64
|
-
// Prepare path for normalization; see comment above for reasoning.
|
|
65
|
-
.map((s) => s.replace(/[\\]+/g, '/'))
|
|
66
|
-
.filter((p) => {
|
|
67
|
-
p = (0, path_1.pathNormalize)(p);
|
|
68
|
-
const i = p.lastIndexOf(fN);
|
|
69
|
-
return i !== -1 && i === p.length - fN.length;
|
|
70
|
-
})
|
|
71
|
-
.map((p) => ({
|
|
72
|
-
token: p,
|
|
73
|
-
seps: count('/', (0, path_1.pathNormalize)(p)),
|
|
74
|
-
penalties: count('node_modules', p) + count('~', p),
|
|
75
|
-
}))
|
|
76
|
-
.sort((a, b) => {
|
|
77
|
-
const s = Math.sign(a.seps - b.seps);
|
|
78
|
-
if (s !== 0) {
|
|
79
|
-
return s;
|
|
80
|
-
}
|
|
81
|
-
return Math.sign(a.penalties - b.penalties);
|
|
82
|
-
});
|
|
83
|
-
if (source.length < 1 || lineNumber == null) {
|
|
84
|
-
return new stack_frame_1.StackFrame(null, null, null, null, null, functionName, fN, lineNumber, columnNumber, null);
|
|
39
|
+
if (frame.type === 'symbolicated') {
|
|
40
|
+
return frame.frame;
|
|
85
41
|
}
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
|
|
42
|
+
const map = mapValues[frame.frame.fileName];
|
|
43
|
+
const pos = map.getOriginalPosition(frame.frame.lineNumber, frame.frame.columnNumber);
|
|
44
|
+
const { functionName } = frame.frame;
|
|
45
|
+
const hasSource = map.getSource(pos.source);
|
|
46
|
+
const scriptCode = hasSource
|
|
47
|
+
? (0, get_lines_around_1.getLinesAround)(pos.line, contextLines, hasSource.split('\n'))
|
|
48
|
+
: null;
|
|
49
|
+
return {
|
|
50
|
+
originalColumnNumber: pos.column,
|
|
51
|
+
originalFileName: pos.source,
|
|
52
|
+
originalFunctionName: functionName,
|
|
53
|
+
originalLineNumber: pos.line,
|
|
54
|
+
originalScriptCode: scriptCode,
|
|
55
|
+
};
|
|
90
56
|
});
|
|
91
|
-
}
|
|
57
|
+
};
|
|
92
58
|
exports.unmap = unmap;
|
|
93
59
|
//# sourceMappingURL=unmapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unmapper.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/unmapper.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF,2BAA2B;AAC3B,+BAA+B;AAC/B;;;;;GAKG;AAEH,yDAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"unmapper.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/unmapper.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF,2BAA2B;AAC3B,+BAA+B;AAC/B;;;;;GAKG;AAEH,uCAAmC;AACnC,yDAAkD;AAClD,qDAAyD;AAOzD,MAAM,eAAe,GAAG,KAAK,E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Ac,EAAE;YAClC,OAAO,KAAK,CAAC,KAAK,CAAC;SACnB;QAED,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,QAAkB,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,GAAG,CAAC,mBAAmB,CAClC,KAAK,CAAC,KAAK,CAAC,UAAoB,EAChC,KAAK,CAAC,KAAK,CAAC,YAAsB,CAClC,CAAC;QAEF,MAAM,EAAC,YAAY,EAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACnC,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,SAAS;YAC3B,CAAC,CAAC,IAAA,iCAAc,EAAC,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/D,CAAC,CAAC,IAAI,CAAC;QAER,OAAO;YACN,oBAAoB,EAAE,GAAG,CAAC,MAAM;YAChC,gBAAgB,EAAE,GAAG,CAAC,MAAM;YAC5B,oBAAoB,EAAE,YAAY;YAClC,kBAAkB,EAAE,GAAG,CAAC,IAAI;YAC5B,kBAAkB,EAAE,UAAU;SAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,KAAK,SA8ChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDisplay.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/remotion-overlay/ErrorDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorDisplay.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/remotion-overlay/ErrorDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,2CAA2C,CAAC;AAmBtE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,WAAW,CAAC;CACrB,CAwDA,CAAC"}
|
|
@@ -7,31 +7,8 @@ const AskOnDiscord_1 = require("./AskOnDiscord");
|
|
|
7
7
|
const OpenInEditor_1 = require("./OpenInEditor");
|
|
8
8
|
const SearchGitHubIssues_1 = require("./SearchGitHubIssues");
|
|
9
9
|
const StackFrame_1 = require("./StackFrame");
|
|
10
|
-
const DismissButton_1 = require("./DismissButton");
|
|
11
10
|
const map_error_to_react_stack_1 = require("../react-overlay/effects/map-error-to-react-stack");
|
|
12
|
-
const
|
|
13
|
-
width: '100%',
|
|
14
|
-
maxWidth: 1000,
|
|
15
|
-
paddingLeft: 14,
|
|
16
|
-
paddingRight: 14,
|
|
17
|
-
marginLeft: 'auto',
|
|
18
|
-
marginRight: 'auto',
|
|
19
|
-
fontFamily: 'SF Pro Text, sans-serif',
|
|
20
|
-
paddingTop: '5vh',
|
|
21
|
-
};
|
|
22
|
-
const title = {
|
|
23
|
-
marginBottom: 8,
|
|
24
|
-
display: 'flex',
|
|
25
|
-
flexDirection: 'row',
|
|
26
|
-
justifyContent: 'center',
|
|
27
|
-
};
|
|
28
|
-
const errName = {
|
|
29
|
-
fontSize: '0.8em',
|
|
30
|
-
background: 'linear-gradient(90deg,#4290f5,#42e9f5)',
|
|
31
|
-
WebkitBackgroundClip: 'text',
|
|
32
|
-
WebkitTextFillColor: 'transparent',
|
|
33
|
-
display: 'inline-block',
|
|
34
|
-
};
|
|
11
|
+
const ErrorTitle_1 = require("./ErrorTitle");
|
|
35
12
|
const stack = {
|
|
36
13
|
marginTop: 17,
|
|
37
14
|
overflowX: 'scroll',
|
|
@@ -41,18 +18,9 @@ const spacer = {
|
|
|
41
18
|
width: 5,
|
|
42
19
|
display: 'inline-block',
|
|
43
20
|
};
|
|
44
|
-
const left = {
|
|
45
|
-
flex: 1,
|
|
46
|
-
paddingRight: 14,
|
|
47
|
-
lineHeight: 1.5,
|
|
48
|
-
whiteSpace: 'pre',
|
|
49
|
-
fontSize: '1.5em',
|
|
50
|
-
fontWeight: 'bold',
|
|
51
|
-
overflowX: 'auto',
|
|
52
|
-
};
|
|
53
21
|
const ErrorDisplay = ({ display }) => {
|
|
54
22
|
const highestLineNumber = Math.max(...display.stackFrames
|
|
55
|
-
.map((s) => s.
|
|
23
|
+
.map((s) => s.originalScriptCode)
|
|
56
24
|
.flat(1)
|
|
57
25
|
.map((s) => { var _a; return (_a = s === null || s === void 0 ? void 0 : s.lineNumber) !== null && _a !== void 0 ? _a : 0; }));
|
|
58
26
|
const message = (0, react_1.useMemo)(() => {
|
|
@@ -68,13 +36,11 @@ const ErrorDisplay = ({ display }) => {
|
|
|
68
36
|
.trim();
|
|
69
37
|
}, [display.error]);
|
|
70
38
|
const lineNumberWidth = String(highestLineNumber).length;
|
|
71
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message }, void 0), display.stackFrames.length > 0 && window.remotion_editorName ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OpenInEditor_1.OpenInEditor, { stack: display.stackFrames[0] }, void 0), (0, jsx_runtime_1.jsx)("div", { style: spacer }, void 0)] }, void 0)) : null, (0, jsx_runtime_1.jsx)(SearchGitHubIssues_1.SearchGithubIssues, { message: display.error.message }, void 0), (0, jsx_runtime_1.jsx)("div", { style: spacer }, void 0), (0, jsx_runtime_1.jsx)(AskOnDiscord_1.AskOnDiscord, {}, void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ style: stack }, { children: display.stackFrames.map((s, i) => {
|
|
72
40
|
return ((0, jsx_runtime_1.jsx)(StackFrame_1.StackElement
|
|
73
41
|
// eslint-disable-next-line react/no-array-index-key
|
|
74
|
-
, { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName:
|
|
75
|
-
|
|
76
|
-
: 'Syntax error' }, i));
|
|
77
|
-
}) }), void 0)] }), void 0));
|
|
42
|
+
, { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)' }, i));
|
|
43
|
+
}) }), void 0)] }, void 0));
|
|
78
44
|
};
|
|
79
45
|
exports.ErrorDisplay = ErrorDisplay;
|
|
80
46
|
//# sourceMappingURL=ErrorDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDisplay.js","sourceRoot":"","sources":["../../../src/error-overlay/remotion-overlay/ErrorDisplay.tsx"],"names":[],"mappings":";;;;AAAA,iCAAqC;AAErC,iDAA4C;AAC5C,iDAA4C;AAC5C,6DAAwD;AACxD,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"ErrorDisplay.js","sourceRoot":"","sources":["../../../src/error-overlay/remotion-overlay/ErrorDisplay.tsx"],"names":[],"mappings":";;;;AAAA,iCAAqC;AAErC,iDAA4C;AAC5C,iDAA4C;AAC5C,6DAAwD;AACxD,6CAA0C;AAC1C,gGAA4F;AAC5F,6CAAwC;AAExC,MAAM,KAAK,GAAwB;IAClC,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,MAAM;CACpB,CAAC;AAEF,MAAM,MAAM,GAAwB;IACnC,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,cAAc;CACvB,CAAC;AAEK,MAAM,YAAY,GAEpB,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE;IAClB,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CACjC,GAAG,OAAO,CAAC,WAAW;SACpB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC;SAChC,IAAI,CAAC,CAAC,CAAC;SACP,GAAG,CAAC,CAA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