@remotion/bundler 3.0.0-lambda.297 → 3.0.0-lambda.310

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.
Files changed (122) hide show
  1. package/dist/dev-middleware/compatible.api.d.ts +1 -0
  2. package/dist/dev-middleware/compatible.api.d.ts.map +1 -0
  3. package/dist/dev-middleware/compatible.api.js +2 -0
  4. package/dist/dev-middleware/compatible.api.js.map +1 -0
  5. package/dist/dev-middleware/compatibleapi.d.ts +1 -0
  6. package/dist/dev-middleware/compatibleapi.d.ts.map +1 -0
  7. package/dist/dev-middleware/compatibleapi.js +2 -0
  8. package/dist/dev-middleware/compatibleapi.js.map +1 -0
  9. package/dist/error-overlay/entry-basic.js +13 -16
  10. package/dist/error-overlay/entry-basic.js.map +1 -1
  11. package/dist/error-overlay/entry-devserver.d.ts +12 -0
  12. package/dist/error-overlay/entry-devserver.d.ts.map +1 -0
  13. package/dist/error-overlay/entry-devserver.js +36 -0
  14. package/dist/error-overlay/entry-devserver.js.map +1 -0
  15. package/dist/error-overlay/index.d.ts +5 -0
  16. package/dist/error-overlay/index.d.ts.map +1 -0
  17. package/dist/error-overlay/index.js +28 -0
  18. package/dist/error-overlay/index.js.map +1 -0
  19. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts.map +1 -1
  20. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js +19 -8
  21. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js.map +1 -1
  22. package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts +2 -2
  23. package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts.map +1 -1
  24. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +5 -11
  25. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -1
  26. package/dist/error-overlay/react-overlay/index.d.ts +1 -7
  27. package/dist/error-overlay/react-overlay/index.d.ts.map +1 -1
  28. package/dist/error-overlay/react-overlay/index.js +8 -35
  29. package/dist/error-overlay/react-overlay/index.js.map +1 -1
  30. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +4 -5
  31. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -1
  32. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +25 -27
  33. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -1
  34. package/dist/error-overlay/react-overlay/stack-frame.d.ts +47 -0
  35. package/dist/error-overlay/react-overlay/stack-frame.d.ts.map +1 -0
  36. package/dist/error-overlay/react-overlay/stack-frame.js +82 -0
  37. package/dist/error-overlay/react-overlay/stack-frame.js.map +1 -0
  38. package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts +1 -1
  39. package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -1
  40. package/dist/error-overlay/react-overlay/utils/get-lines-around.js +5 -11
  41. package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -1
  42. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +1 -16
  43. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -1
  44. package/dist/error-overlay/react-overlay/utils/get-source-map.js +4 -28
  45. package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -1
  46. package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts +2 -9
  47. package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -1
  48. package/dist/error-overlay/react-overlay/utils/get-stack-frames.js +7 -28
  49. package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -1
  50. package/dist/error-overlay/react-overlay/utils/parser.d.ts +2 -13
  51. package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -1
  52. package/dist/error-overlay/react-overlay/utils/parser.js +45 -11
  53. package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -1
  54. package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +27 -24
  55. package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -1
  56. package/dist/error-overlay/react-overlay/utils/stack-frame.js +21 -60
  57. package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -1
  58. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +2 -12
  59. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -1
  60. package/dist/error-overlay/react-overlay/utils/unmapper.js +34 -71
  61. package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -1
  62. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -1
  63. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +5 -39
  64. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -1
  65. package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts +5 -0
  66. package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts.map +1 -0
  67. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +62 -0
  68. package/dist/error-overlay/remotion-overlay/ErrorLoader.js.map +1 -0
  69. package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts +7 -0
  70. package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts.map +1 -0
  71. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +42 -0
  72. package/dist/error-overlay/remotion-overlay/ErrorTitle.js.map +1 -0
  73. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +2 -2
  74. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -1
  75. package/dist/error-overlay/remotion-overlay/Overlay.d.ts +2 -4
  76. package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -1
  77. package/dist/error-overlay/remotion-overlay/Overlay.js +24 -9
  78. package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -1
  79. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +2 -2
  80. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -1
  81. package/dist/error-overlay/remotion-overlay/StackFrame.js +4 -4
  82. package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -1
  83. package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts +3 -0
  84. package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts.map +1 -0
  85. package/dist/error-overlay/remotion-overlay/Symbolicating.js +9 -0
  86. package/dist/error-overlay/remotion-overlay/Symbolicating.js.map +1 -0
  87. package/dist/get-latest-remotion-version.d.ts +2 -0
  88. package/dist/get-latest-remotion-version.d.ts.map +1 -0
  89. package/dist/get-latest-remotion-version.js +32 -0
  90. package/dist/get-latest-remotion-version.js.map +1 -0
  91. package/dist/get-package-manager.d.ts +3 -0
  92. package/dist/get-package-manager.d.ts.map +1 -0
  93. package/dist/get-package-manager.js +41 -0
  94. package/dist/get-package-manager.js.map +1 -0
  95. package/dist/index.d.ts +3 -0
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +4 -0
  98. package/dist/index.js.map +1 -1
  99. package/dist/setup-env-variables.d.ts +2 -0
  100. package/dist/setup-env-variables.d.ts.map +1 -0
  101. package/dist/setup-env-variables.js +5 -0
  102. package/dist/setup-env-variables.js.map +1 -0
  103. package/dist/start-server.d.ts.map +1 -1
  104. package/dist/start-server.js +3 -3
  105. package/dist/start-server.js.map +1 -1
  106. package/dist/test/latest-remotion-version.d.ts +2 -0
  107. package/dist/test/latest-remotion-version.d.ts.map +1 -0
  108. package/dist/test/latest-remotion-version.js +7 -0
  109. package/dist/test/latest-remotion-version.js.map +1 -0
  110. package/dist/test/latest-remotion-version.test.d.ts +2 -0
  111. package/dist/test/latest-remotion-version.test.d.ts.map +1 -0
  112. package/dist/test/latest-remotion-version.test.js +7 -0
  113. package/dist/test/latest-remotion-version.test.js.map +1 -0
  114. package/dist/test/parse-module-not-found.test.d.ts +2 -0
  115. package/dist/test/parse-module-not-found.test.d.ts.map +1 -0
  116. package/dist/test/parse-module-not-found.test.js +18 -0
  117. package/dist/test/parse-module-not-found.test.js.map +1 -0
  118. package/dist/update-available.d.ts +1 -1
  119. package/dist/update-available.d.ts.map +1 -1
  120. package/dist/update-available.js +5 -11
  121. package/dist/update-available.js.map +1 -1
  122. package/package.json +3 -4
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=compatible.api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatible.api.d.ts","sourceRoot":"","sources":["../../src/dev-middleware/compatible.api.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=compatible.api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatible.api.js","sourceRoot":"","sources":["../../src/dev-middleware/compatible.api.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=compatibleapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibleapi.d.ts","sourceRoot":"","sources":["../../src/dev-middleware/compatibleapi.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=compatibleapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibleapi.js","sourceRoot":"","sources":["../../src/dev-middleware/compatibleapi.ts"],"names":[],"mappings":""}
@@ -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
- onError() {
8
- if (module.hot) {
9
- module.hot.addStatusHandler((status) => {
10
- var _a;
11
- if (status === 'apply') {
12
- if ((0, react_overlay_1.shouldReload)()) {
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,mDAIyB;AACzB,yDAAwD;AACxD,wDAAwD;AAExD,IAAA,2CAA2B,EAAC;IAC3B,OAAO;QACN,IAAI,MAAM,CAAC,GAAG,EAAE;YACf,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE;;gBACtC,IAAI,MAAM,KAAK,OAAO,EAAE;oBACvB,IAAI,IAAA,4BAAY,GAAE,EAAE;wBACnB,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;qBAChC;oBAED,IAAA,6BAAa,GAAE,CAAC;oBAChB,MAAA,sBAAY,CAAC,OAAO,0CAAE,SAAS,CAAC;wBAC/B,IAAI,EAAE,OAAO;qBACb,CAAC,CAAC;iBACH;YACF,CAAC,CAAC,CAAC;SACH;IACF,CAAC;CACD,CAAC,CAAC;AACH,IAAA,uCAAoB,GAAE,CAAC"}
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"}
@@ -0,0 +1,12 @@
1
+ declare const querystring: any;
2
+ declare const url: any;
3
+ declare const SockJS: any;
4
+ declare const formatWebpackMessages: any;
5
+ declare const reportBuildError: any, dismissBuildError: any;
6
+ declare let sockOptions: {
7
+ sockHost?: string;
8
+ sockPort?: string;
9
+ sockPath?: string;
10
+ };
11
+ declare const connection: any;
12
+ //# sourceMappingURL=entry-devserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-devserver.d.ts","sourceRoot":"","sources":["../../src/error-overlay/entry-devserver.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,WAAW,KAAyB,CAAC;AAC3C,QAAA,MAAM,GAAG,KAAiB,CAAC;AAC3B,QAAA,MAAM,MAAM,KAA2B,CAAC;AACxC,QAAA,MAAM,qBAAqB,KAAmD,CAAC;AAC/E,QAAA,MAAO,gBAAgB,OAAE,iBAAiB,KAAkC,CAAC;AAE7E,QAAA,IAAI,WAAW,EAAE;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAKP,QAAA,MAAM,UAAU,KAOf,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // @ts-check
3
+ const querystring = require('querystring');
4
+ const url = require('url');
5
+ const SockJS = require('sockjs-client');
6
+ const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
7
+ const { reportBuildError, dismissBuildError } = require('react-error-overlay');
8
+ let sockOptions = {};
9
+ if (typeof __resourceQuery === 'string' && __resourceQuery.length > 1) {
10
+ sockOptions = querystring.parse(__resourceQuery.substr(1));
11
+ }
12
+ const connection = new SockJS(url.format({
13
+ protocol: window.location.protocol,
14
+ hostname: sockOptions.sockHost || window.location.hostname,
15
+ port: sockOptions.sockPort || window.location.port,
16
+ pathname: sockOptions.sockPath || '/sockjs-node',
17
+ }));
18
+ connection.onmessage = function (e) {
19
+ const { type, data } = JSON.parse(e.data);
20
+ let formatted;
21
+ switch (type) {
22
+ case 'ok':
23
+ dismissBuildError();
24
+ break;
25
+ case 'errors':
26
+ formatted = formatWebpackMessages({
27
+ errors: data,
28
+ warnings: [],
29
+ });
30
+ reportBuildError(formatted.errors[0]);
31
+ break;
32
+ default:
33
+ // Do nothing.
34
+ }
35
+ };
36
+ //# sourceMappingURL=entry-devserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-devserver.js","sourceRoot":"","sources":["../../src/error-overlay/entry-devserver.ts"],"names":[],"mappings":";AAAA,YAAY;AACZ,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AACxC,MAAM,qBAAqB,GAAG,OAAO,CAAC,uCAAuC,CAAC,CAAC;AAC/E,MAAM,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAE7E,IAAI,WAAW,GAIX,EAAE,CAAC;AACP,IAAI,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;IACtE,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3D;AAED,MAAM,UAAU,GAAG,IAAI,MAAM,CAC5B,GAAG,CAAC,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ;IAClC,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ;IAC1D,IAAI,EAAE,WAAW,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI;IAClD,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,cAAc;CAChD,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,SAAS,GAAG,UAAU,CAAiB;IACjD,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,SAAS,CAAC;IACd,QAAQ,IAAI,EAAE;QACb,KAAK,IAAI;YACR,iBAAiB,EAAE,CAAC;YACpB,MAAM;QACP,KAAK,QAAQ;YACZ,SAAS,GAAG,qBAAqB,CAAC;gBACjC,MAAM,EAAE,IAAI;gBACZ,QAAQ,EAAE,EAAE;aACZ,CAAC,CAAC;YACH,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACtC,MAAM;QACP,QAAQ;QACR,cAAc;KACd;AACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import webpack from 'webpack';
2
+ export declare class ErrorOverlayPlugin {
3
+ apply(compiler: webpack.Compiler): void;
4
+ }
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-overlay/index.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAc9B,qBAAa,kBAAkB;IAC9B,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;CAsBhC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorOverlayPlugin = void 0;
4
+ const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
5
+ const chunkPathBasic = require.resolve('./entry-basic.js');
6
+ const chunkPathDevServer = require.resolve('./entry-devserver.js');
7
+ const deps = [];
8
+ class ErrorOverlayPlugin {
9
+ apply(compiler) {
10
+ const className = this.constructor.name;
11
+ if (compiler.options.mode !== 'development') {
12
+ return;
13
+ }
14
+ if (!compiler.options.devServer) {
15
+ return;
16
+ }
17
+ const devServerEnabled = Boolean(compiler.options.devServer);
18
+ const usingSocket = devServerEnabled && typeof compiler.options.devServer.socket === 'string';
19
+ const sockOptions = {};
20
+ if (devServerEnabled && usingSocket) {
21
+ sockOptions.sockHost = compiler.options.devServer.sockHost;
22
+ sockOptions.sockPath = compiler.options.devServer.sockPath;
23
+ sockOptions.sockPort = compiler.options.devServer.sockPort;
24
+ }
25
+ }
26
+ }
27
+ exports.ErrorOverlayPlugin = ErrorOverlayPlugin;
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error-overlay/index.ts"],"names":[],"mappings":";;;AAGA,MAAM,sBAAsB,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AAEjF,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC3D,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;AACnE,MAAM,IAAI,GAAa,EAAE,CAAC;AAQ1B,MAAa,kBAAkB;IAC9B,KAAK,CAAC,QAA0B;QAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAExC,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE;YAC5C,OAAO;SACP;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE;YAChC,OAAO;SACP;QAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,WAAW,GAChB,gBAAgB,IAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC;QAE3E,MAAM,WAAW,GAAgB,EAAE,CAAC;QACpC,IAAI,gBAAgB,IAAI,WAAW,EAAE;YACpC,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC;YAC3D,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC;YAC3D,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC;SAC3D;IACF,CAAC;CACD;AAvBD,gDAuBC"}
@@ -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,IAqCtE,CAAC"}
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
- if (s.match(/^\s+at/g)) {
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
- const matchWebpackOrEsbuild = s.match(/(.*):([0-9]+):([0-9]+): (.*)/);
23
- if (!matchWebpackOrEsbuild) {
33
+ if (s.includes('webpackMissingModule')) {
24
34
  return null;
25
35
  }
36
+ const [, filename] = matchMissingModule;
26
37
  return {
27
- fileName: matchWebpackOrEsbuild[1],
28
- lineNumber: Number(matchWebpackOrEsbuild[2]),
29
- columnNumber: Number(matchWebpackOrEsbuild[3]),
30
- message: matchWebpackOrEsbuild[4],
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,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC,EAAE;QACxD,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,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC;SACZ;QAED,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAEtE,IAAI,CAAC,qBAAqB,EAAE;YAC3B,OAAO,IAAI,CAAC;SACZ;QAED,OAAO;YACN,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC;YAClC,UAAU,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC5C,YAAY,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC9C,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;SACjC,CAAC;IACH,CAAC,CAAC;SACD,MAAM,CAAC,oBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,mCAAI,IAAI,CACrC,CAAC;AACH,CAAC,CAAC;AArCW,QAAA,yBAAyB,6BAqCpC"}
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 { StackFrame } from '../utils/stack-frame';
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<StackFrame>;
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,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,aACnB,aAAa,gBACT,MAAM,KAClB,QAAQ,UAAU,CAuCpB,CAAC"}
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
- _originalScriptCode: scriptCode,
25
- _originalColumnNumber: location.columnNumber,
26
- _originalFileName: location.fileName,
27
- _originalLineNumber: location.lineNumber,
28
- _scriptCode: scriptCode,
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,EACE,EAAE;IACxB,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,mBAAmB,EAAE,UAAU;QAC/B,qBAAqB,EAAE,QAAQ,CAAC,YAAY;QAC5C,iBAAiB,EAAE,QAAQ,CAAC,QAAQ;QACpC,mBAAmB,EAAE,QAAQ,CAAC,UAAU;QACxC,WAAW,EAAE,UAAU;QACvB,qBAAqB,EAAE,IAAI;QAC3B,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,UAAU,EAAE,QAAQ,CAAC,UAAU;KAC/B,CAAC;AACH,CAAC,CAAC;AA1CW,QAAA,iBAAiB,qBA0C5B"}
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(options: RuntimeReportingOptions): void;
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":"AAIA,aAAK,uBAAuB,GAAG;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,eAAO,MAAM,aAAa,YAEzB,CAAC;AAEF,eAAO,MAAM,YAAY,eAExB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,QAuC3E"}
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 = exports.dismissErrors = void 0;
4
- const Overlay_1 = require("../remotion-overlay/Overlay");
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
- return currentRuntimeErrorRecords.some((e) => e.type === 'syntax');
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(options) {
12
+ function startReportingRuntimeErrors(onError) {
17
13
  if (stopListeningToRuntimeErrors !== null) {
18
14
  throw new Error('Already listening');
19
15
  }
20
- const handleRuntimeError = (opts) => (errorRecord) => {
21
- try {
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
- function update() {
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,yDAAyD;AACzD,yEAA8E;AAE9E,IAAI,4BAA4B,GAAwB,IAAI,CAAC;AAM7D,IAAI,0BAA0B,GAAkB,EAAE,CAAC;AAE5C,MAAM,aAAa,GAAG,GAAG,EAAE;IACjC,0BAA0B,GAAG,EAAE,CAAC;AACjC,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEK,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,OAAO,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF,SAAgB,2BAA2B,CAAC,OAAgC;IAC3E,IAAI,4BAA4B,KAAK,IAAI,EAAE;QAC1C,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACrC;IAED,MAAM,kBAAkB,GACvB,CAAC,IAA6B,EAAE,EAAE,CAAC,CAAC,WAAwB,EAAE,EAAE;QAC/D,IAAI;YACH,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE;gBACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACxB;SACD;gBAAS;YACT,IACC,0BAA0B,CAAC,IAAI,CAC9B,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,KAAK,CACxC,EACA;gBACD,gCAAgC;gBAChC,uEAAuE;aACvE;iBAAM;gBACN,0BAA0B,GAAG,0BAA0B,CAAC,MAAM,CAAC;oBAC9D,WAAW;iBACX,CAAC,CAAC;gBACH,MAAM,EAAE,CAAC;aACT;SACD;IACF,CAAC,CAAC;IAEH,SAAS,MAAM;;QACd,MAAA,sBAAY,CAAC,OAAO,0CAAE,SAAS,CAAC;YAC/B,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,0BAA0B;SAClC,CAAC,CAAC;IACJ,CAAC;IAED,4BAA4B,GAAG,IAAA,gDAAqB,EACnD,kBAAkB,CAAC,OAAO,CAAC,EAC3B,OAAO,CAAC,QAAkB,CAC1B,CAAC;AACH,CAAC;AAvCD,kEAuCC"}
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 { StackFrame } from './utils/stack-frame';
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: StackFrame[];
7
- type: 'exception' | 'syntax';
5
+ stackFrames: SymbolicatedStackFrame[];
8
6
  };
9
- export declare function listenToRuntimeErrors(crash: (rec: ErrorRecord) => void, filename: string): () => void;
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,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,oBAAY,WAAW,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC;CAC7B,CAAC;AAkEF,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,EACjC,QAAQ,EAAE,MAAM,cAsChB"}
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 crashWithFrames = (crash) => async (error, unhandledRejection) => {
19
- var _a;
20
- try {
21
- (_a = Overlay_1.setErrorsRef.current) === null || _a === void 0 ? void 0 : _a.setErrors({
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, filename) {
35
+ function listenToRuntimeErrors(crash) {
41
36
  const crashWithFramesRunTime = crashWithFrames(crash);
42
37
  (0, unhandled_error_1.register)(window, (error) => {
43
- return crashWithFramesRunTime(error, false);
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, true);
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
- }, false);
57
+ });
60
58
  }
61
59
  if (d.type === 'build-error') {
62
- crashWithFramesRunTime(d.error, false);
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":";;;AAUA;;;;;GAKG;AAEH,+DAGmC;AACnC,uEAGuC;AACvC,mEAGqC;AACrC,2DAIiC;AACjC,6DAAwD;AACxD,+DAAwD;AACxD,yDAAyD;AAEzD,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,eAAe,GACpB,CAAC,KAAiC,EAAE,EAAE,CACtC,KAAK,EACJ,KAEC,EACD,kBAA2B,EAC1B,EAAE;;IACH,IAAI;QACH,MAAA,sBAAY,CAAC,OAAO,0CAAE,SAAS,CAAC;YAC/B,IAAI,EAAE,eAAe;SACrB,CAAC,CAAC;QAEH,MAAM,EAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAC,GAAG,MAAM,IAAA,iCAAc,EACvD,KAAK,EACL,YAAY,CACZ,CAAC;QAEF,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;YACtD,OAAO;SACP;QAED,KAAK,CAAC;YACL,KAAK;YACL,kBAAkB;YAClB,WAAW,EAAE,YAAY;YACzB,WAAW;YACX,IAAI;SACJ,CAAC,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,CAAC,CAAC,CAAC;KAC3D;AACF,CAAC,CAAC;AAEH,SAAgB,qBAAqB,CACpC,KAAiC,EACjC,QAAgB;IAEhB,MAAM,sBAAsB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEtD,IAAA,0BAAa,EAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QAC/B,OAAO,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,IAAA,8BAAe,EAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QACjC,OAAO,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5C,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;YAC7C,sBAAsB,CACrB;gBACC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,cAAc,EAAE,QAAQ;gBACxB,IAAI,EAAE,EAAE;aACR,EACD,KAAK,CACL,CAAC;SACF;QAED,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7B,sBAAsB,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACvC;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;AAxCD,sDAwCC"}
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"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
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
+ /** A container holding a script line. */
8
+ declare class ScriptLine {
9
+ /** The line number of this line of source. */
10
+ lineNumber: number;
11
+ /** The content (or value) of this line of source. */
12
+ content: string;
13
+ /** Whether or not this line should be highlighted. Particularly useful for error reporting with context. */
14
+ highlight: boolean;
15
+ constructor(lineNumber: number, content: string, highlight?: boolean);
16
+ }
17
+ /**
18
+ * A representation of a stack frame.
19
+ */
20
+ export declare class StackFrame {
21
+ functionName: string | null;
22
+ fileName: string | null;
23
+ lineNumber: number | null;
24
+ columnNumber: number | null;
25
+ _originalFunctionName: string | null;
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 name of this function.
34
+ */
35
+ getFunctionName(): string;
36
+ /**
37
+ * Returns the source of the frame.
38
+ * This contains the file name, line number, and column number when available.
39
+ */
40
+ getSource(): string;
41
+ /**
42
+ * Returns a pretty version of this stack frame.
43
+ */
44
+ toString(): string;
45
+ }
46
+ export {};
47
+ //# sourceMappingURL=stack-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-frame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/stack-frame.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,yCAAyC;AACzC,cAAM,UAAU;IACf,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,SAAS,EAAE,OAAO,CAAC;gBAEP,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,UAAQ;CAKlE;AAED;;GAEG;AACH,qBAAa,UAAU;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;gBAIxC,YAAY,GAAE,MAAM,GAAG,IAAW,EAClC,QAAQ,GAAE,MAAM,GAAG,IAAW,EAC9B,UAAU,GAAE,MAAM,GAAG,IAAW,EAChC,YAAY,GAAE,MAAM,GAAG,IAAW,EAClC,UAAU,GAAE,UAAU,EAAE,GAAG,IAAW,EACtC,kBAAkB,GAAE,MAAM,GAAG,IAAW,EACxC,cAAc,GAAE,MAAM,GAAG,IAAW,EACpC,gBAAgB,GAAE,MAAM,GAAG,IAAW,EACtC,kBAAkB,GAAE,MAAM,GAAG,IAAW,EACxC,gBAAgB,GAAE,UAAU,EAAE,GAAG,IAAW;IAiC7C;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAiBnB;;OAEG;IACH,QAAQ,IAAI,MAAM;CAKlB"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2015-present, Facebook, Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.StackFrame = void 0;
10
+ /* @flow */
11
+ /** A container holding a script line. */
12
+ class ScriptLine {
13
+ constructor(lineNumber, content, highlight = false) {
14
+ this.lineNumber = lineNumber;
15
+ this.content = content;
16
+ this.highlight = highlight;
17
+ }
18
+ }
19
+ /**
20
+ * A representation of a stack frame.
21
+ */
22
+ class StackFrame {
23
+ // eslint-disable-next-line max-params
24
+ constructor(functionName = null, fileName = null, lineNumber = null, columnNumber = null, scriptCode = null, sourceFunctionName = null, sourceFileName = null, sourceLineNumber = null, sourceColumnNumber = null, sourceScriptCode = null) {
25
+ if (functionName && functionName.indexOf('Object.') === 0) {
26
+ functionName = functionName.slice('Object.'.length);
27
+ }
28
+ if (
29
+ // Chrome has a bug with inferring function.name:
30
+ // https://github.com/facebook/create-react-app/issues/2097
31
+ // Let's ignore a meaningless name we get for top-level modules.
32
+ functionName === 'friendlySyntaxErrorLabel' ||
33
+ functionName === 'exports.__esModule' ||
34
+ functionName === '<anonymous>' ||
35
+ !functionName) {
36
+ functionName = null;
37
+ }
38
+ this.functionName = functionName;
39
+ this.fileName = fileName;
40
+ this.lineNumber = lineNumber;
41
+ this.columnNumber = columnNumber;
42
+ this._originalFunctionName = sourceFunctionName;
43
+ this._originalFileName = sourceFileName;
44
+ this._originalLineNumber = sourceLineNumber;
45
+ this._originalColumnNumber = sourceColumnNumber;
46
+ this._scriptCode = scriptCode;
47
+ this._originalScriptCode = sourceScriptCode;
48
+ }
49
+ /**
50
+ * Returns the name of this function.
51
+ */
52
+ getFunctionName() {
53
+ return this.functionName || '(anonymous function)';
54
+ }
55
+ /**
56
+ * Returns the source of the frame.
57
+ * This contains the file name, line number, and column number when available.
58
+ */
59
+ getSource() {
60
+ let str = '';
61
+ if (this.fileName !== null) {
62
+ str += this.fileName + ':';
63
+ }
64
+ if (this.lineNumber !== null) {
65
+ str += this.lineNumber + ':';
66
+ }
67
+ if (this.columnNumber !== null) {
68
+ str += this.columnNumber + ':';
69
+ }
70
+ return str.slice(0, -1);
71
+ }
72
+ /**
73
+ * Returns a pretty version of this stack frame.
74
+ */
75
+ toString() {
76
+ const functionName = this.getFunctionName();
77
+ const source = this.getSource();
78
+ return `${functionName}${source ? ` (${source})` : ``}`;
79
+ }
80
+ }
81
+ exports.StackFrame = StackFrame;
82
+ //# sourceMappingURL=stack-frame.js.map