Skip to content

fix(core): preserve composition startup error stacks - #6353

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/startup-error-stack
Oct 26, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/startup-error-stack

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

Composition startup errors now include a short stack after the error name and message: the first three frames plus the first recognized composition frame, all on one line. This identifies the throwing library and the authored call site when the browser supplies those locations. Headerless browser stacks and unavailable stack getters retain useful diagnostics.

The troubleshooting guide explains these locations. The required tracked position-edit helper was regenerated; only minified local identifiers changed.

Validation: 11 regressions fail on the original source; 74 focused diagnostics, startup and position-edit tests pass. Full build, typechecks, lint/format, runtime checks, test reachability, normal commit hooks, comment checks and Mint checks pass. Native Chrome 152 checks pass for real thrown-error stacks with the compiler source URL, a custom HTML path and an extensionless preview URL. These checks use local test pages; the original Windows GSAP fixture was not run.

Fixes #6334

@mintlify

mintlify Bot commented Oct 25, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit f347fae.

Approve preview

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Startup errors now keep their stack locations and still fall back to the message when there's no stack. Removing the stack attachment fails 12 tests, and the regenerated bundle differs only by renamed identifiers.

@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 25, 2026

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a careful fix and the tests are thorough. I regenerated position-edits-render-inline.ts from the generator at this head and it matches the committed file exactly, so the change there is just minifier renaming. The tests are doing real work: removing the stack attachment fails 12 of them, removing the composition-frame step fails 7, and dropping the whitespace collapse or allowing hyperframes:// frames each fails at least one. Errors without a usable stack and non-Error throws still get the same message as before.

One suggestion for the docs (docs/guides/troubleshooting.mdx:206). In a render, the composition's inline scripts all show up as hyperframes-composition://body, and the line numbers count from the start of each <script>, not from the top of the HTML file. I checked this in Chrome 152 with two inline scripts below 20 lines of markup: the frames read hyperframes-composition://body:3:8 and hyperframes-composition://body:2:32. Someone following the guide would likely open line 3 of index.html. A sentence like "hyperframes-composition://body means one of your composition's inline scripts; its line number counts from that script's opening tag, and the function name in the frame tells you which one" would prevent that. Not blocking.

Verdict: APPROVE
Reasoning: Stacks are kept on one line with a bounded frame count, the generated file matches its generator, fallbacks are covered, every behavior is pinned by tests that fail without it, and CI is green; the docs note is a small follow-up.

Merged via the queue into heygen-com:main with commit 3c016f6 Oct 26, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composition script crashes surface as an unrelated TypeError pointing at window.__timelines (runtime drops Error.stack)

3 participants