π₯ Make videos programmatically with React
fix + test for symbolicated stacktrace
Jonny Burgera21b5e10daf3
diff --git a/packages/it-tests/src/rendering/cancel-render.test.ts b/packages/it-tests/src/rendering/cancel-render.test.tsindex 9e34254672..b3d1c6f511 100644--- a/packages/it-tests/src/rendering/cancel-render.test.ts+++ b/packages/it-tests/src/rendering/cancel-render.test.ts@@ -27,7 +27,18 @@ test("Should fail to render if cancelRender() was being used", async () => {reject: false,});+expect(task.exitCode).toBe(1);expect(task.stderr).toContain("CancelledError");expect(task.stderr).toContain("This should be the error message");++ // Should symbolicate stacktrace+ expect(task.stdout).toContain("at src/CancelRender/index.tsx:18");+ expect(task.stdout).toContain(+ "16 β \t// Worst case: Inside a promise without a catch handler\n"+ );+ expect(task.stdout).toContain("17 β \t// and with a timeout running\n");+ expect(task.stdout).toContain(+ "18 β \tcancelRender(new Error('This should be the error message'));\n"+ );});diff --git a/packages/renderer/src/assets/read-file.ts b/packages/renderer/src/assets/read-file.tsindex 5696e88861..49d93239e4 100644--- a/packages/renderer/src/assets/read-file.ts+++ b/packages/renderer/src/assets/read-file.ts@@ -11,7 +11,9 @@ const getClient = (url: string) => {return http.get;}- throw new Error('Can only download URLs starting with http:// or https://');+ throw new Error(+ `Can only download URLs starting with http:// or https://, got "${url}"`+ );};const readFileWithoutRedirect = (diff --git a/packages/renderer/src/symbolicate-stacktrace.ts b/packages/renderer/src/symbolicate-stacktrace.tsindex efe050603b..6065262279 100644--- a/packages/renderer/src/symbolicate-stacktrace.ts+++ b/packages/renderer/src/symbolicate-stacktrace.ts@@ -52,12 +52,15 @@ const getSourceMap = async (return new SourceMapConsumer(JSON.parse(converted) as RawSourceMap);}- // Find adjacent file: bundle.js -> bundle.js.map- const url = path.join(path.dirname(filePath), sm);if (type === 'local') {- return new SourceMapConsumer(readFileSync(url, 'utf8'));+ // Find adjacent file: bundle.js -> bundle.js.map+ const newFilePath = path.join(path.dirname(filePath), sm);+ return new SourceMapConsumer(readFileSync(newFilePath, 'utf8'));}+ const index = filePath.lastIndexOf('/');+ const url = filePath.substring(0, index + 1) + sm;+const obj = await fetchUrl(url);return new SourceMapConsumer(obj);};