Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
fix(studio): keep a literal relative require out of the canvas-stub docs
Vance Ingallsdb78b4fe68c9
diff --git a/packages/studio/src/shims/canvasBrowserStub.js b/packages/studio/src/shims/canvasBrowserStub.jsindex 0a9153e789..005ba0d1c2 100644--- a/packages/studio/src/shims/canvasBrowserStub.js+++ b/packages/studio/src/shims/canvasBrowserStub.js@@ -2,10 +2,9 @@* Browser stub for the Node-only `canvas` package.** linkedom's `HTMLCanvasElement` constructor calls `createCanvas(300, 150)`- * (300x150 being the HTML canvas default size). linkedom guards that import:- *- * try { module.exports = require('canvas') }- * catch { module.exports = require('./canvas-shim.cjs') }+ * (300x150 being the HTML canvas default size). linkedom guards that import in+ * a try/catch: the try requires the native `canvas` package, and the catch+ * falls back to linkedom's own bundled canvas shim.** That guard only works with a *runtime* require. Vite resolves the specifier* statically, so the bundled form is a plain assignment that cannot throw, thediff --git a/packages/studio/src/utils/sdkCanvasComposition.test.ts b/packages/studio/src/utils/sdkCanvasComposition.test.tsindex 07097af1da..2f4185588f 100644--- a/packages/studio/src/utils/sdkCanvasComposition.test.ts+++ b/packages/studio/src/utils/sdkCanvasComposition.test.ts@@ -6,13 +6,13 @@ import { openComposition } from "@hyperframes/sdk";/*** linkedom's HTMLCanvasElement constructor calls `createCanvas(300, 150)` from- * the Node-only `canvas` package. linkedom guards that import with- * `try { require('canvas') } catch { require('./canvas-shim.cjs') }` — but a- * bundler resolves the require statically, so the catch never fires in the- * browser build and `createCanvas` lands undefined. Parsing any `<canvas>` tag- * then throws, `openComposition` rejects, and Studio silently loses its SDK- * session for the whole composition (no cutover, and the resolver shadow does- * not run either).+ * the Node-only `canvas` package. linkedom guards that import in a try/catch —+ * try the native package, fall back to its own bundled shim — but a bundler+ * resolves the require statically, so the catch never fires in the browser+ * build and `createCanvas` lands undefined. Parsing any `<canvas>` tag then+ * throws, `openComposition` rejects, and Studio silently loses its SDK session+ * for the whole composition (no cutover, and the resolver shadow does not run+ * either).** Production telemetry, 72h after the v0.8.47 flip: 1065 of 1544* `studio:sdk_session_unavailable` events were this crash, spread across a