Skip to content

HTML: frame 0 is drawn before the GSAP timeline's time-0 sets apply (wrong poster frame) #79

Closed

Description

@juansilvadesign

What happens

In an HTML (HyperFrames-style) composition, frame 0 is drawn without the GSAP timeline's state at time 0. tl.set(…, 0) calls are not applied to the first frame, so it shows the page's raw CSS. Frame 1 onward is correct.

This affects both raea render PAGE.html -o OUT.mp4 (the mp4's first frame) and --at 0. For a composition whose frame 0 is its poster/thumbnail, the poster comes out wrong: in our case every caption that a set hides at 0 is drawn on top of each other.

Repro (raea 0.1.0, linux-x86_64 release)

index.html, with GSAP 3.14.2's gsap.min.js next to it:

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8" />
    <script src="gsap.min.js"></script>
    <style>
      html, body { margin: 0; width: 640px; height: 360px; overflow: hidden; background: #fff; }
      .clip { position: absolute; inset: 0; }
      #a, #b { position: absolute; left: 40px; top: 140px; font: 700 48px sans-serif; }
      #a { color: #c00; }
      #b { color: #00c; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="2" data-fps="30" data-width="640" data-height="360">
      <div class="clip" data-start="0" data-duration="2">
        <div id="a">A: hidden at 0</div>
        <div id="b">B: shown at 0</div>
      </div>
    </div>
    <script>
      window.__timelines = window.__timelines || {};
      const tl = gsap.timeline({ paused: true });
      tl.set("#a", { opacity: 0 }, 0);
      tl.set("#b", { x: 200 }, 0);
      tl.to("#a", { opacity: 1, duration: 0.5 }, 1);
      window.__timelines["main"] = tl;
    </script>
  </body>
</html>
RAEA_OFFLINE=1 RAEA_EXPORT_CACHE=0 raea render index.html -o frames/ --at 0,1

Expected (as in Chrome / HyperFrames), frames 0 and 1 identical: only B, shifted 200 px right.
Actual:

  • frame-00000.png: A drawn in red at full opacity, B unshifted, both texts overlapping at x = 40.
  • frame-00001.png: correct (A hidden, B at x = 240).

Environment

  • raea 0.1.0 (release tarball, sha256 checked), Linux x86_64
  • Reproduced on Ubuntu 26.04 with an Intel HD 630 (Mesa Vulkan), and on Ubuntu 24.04 under WSL2 with llvmpipe, so it doesn't depend on the GPU.
  • Found while rendering a 1,800-frame GSAP showcase: frames 1–1799 matched the HyperFrames render, and only frame 0 differed.

Possibly related

The same page logs usvg … Failed to parse transform value: 'translate(1500px, 1000px)' for an inline <svg> that GSAP moves with x/y. GSAP writes px units, which SVG's transform attribute grammar doesn't allow. The element still ends up in the right place on later frames, so this is just noise in the log, but it may be worth handling the same way #60 handled stylesheet transforms.

Activity

  1. Ragulsundaram commented on Nov 10, 2026

    @Ragulsundaram
    Contributor

    I hit this too and traced it: a paused GSAP timeline's playhead starts at 0, so totalTime(0) is a no-op and the time-0 sets never render. Reproduces in plain GSAP 3.14.2, no raea needed.

    A 2-line fix in sdk/ui/src/html/page/time.ts seek(): at t=0, call tl.render(0, false, true) instead. I have it with a regression test (fails without it, all sdk/ui tests pass with it). Happy to open a PR if you'd like one.

  2. added 2 commits that reference this issue on Nov 10, 2026
  3. shinyobjectz commented on Nov 10, 2026

    @shinyobjectz
    Owner

    Fixed by #81 (merged as 4eb42e3): at t=0 the seek forces the timeline's render, so frame 0 has its time-0 sets. It will be in the next release.

  4. added a commit that references this issue on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions