Skip to content

Deno Fresh support for Remotion Player #3802

@damonrand

Description

@damonrand

Ask

Add (or document) support for @remotion/player
in Fresh. Player is how you embed a Remotion composition in a React/Preact
app and pass runtime inputProps so one composition can render
differently per user/scenario/record. In Fresh + Preact-compat it doesn't
render — the SVG container mounts but stays empty.

Without it, the only path is pre-rendered mp4s. Fine for fixed marketing
assets, kills the runtime-parameterised use case Remotion is best at.

Live evidence

https://skyprospector.com/test-remotion — both delivery options
side-by-side (working static mp4 vs broken Player), with browser-side
diagnostic data printed inline (typeof Player === "object", Player keys
= [$$typeof, render]). Also has the full root-cause writeup, the things
I tried, and possible resolution paths so you don't have to repro
anything to see the shape of the problem.

Root cause (TL;DR)

Player's pre-bundled ESM does var Player = forwardRef(PlayerFn) with
forwardRef from import "react". That import resolves to real
react@19 from npm at runtime, not to the preact/compat alias declared
in deno.json. Real React's forwardRef returns {$$typeof, render}
(an object); Preact's returns a function. Preact silently can't render
the object → empty DOM, no error.

Confirmed in the browser that our island's import "react" correctly
aliases to preact/compat — the aliasing just doesn't propagate to
internal imports of pre-bundled npm packages.

Environment

Fresh 2.3.3, Preact 10.29.1, @remotion/player + remotion
4.0.456, react / react-dom aliased in deno.json to
npm:preact@^10.27.2/compat. Deno (current stable).

Tried (none fixed it): client-only mount via useEffect, Fresh 2.2 →
2.3.3, project-root vite.config.ts with resolve.alias + dedupe +
optimizeDeps.include. Details on the page.

Possible directions

  • Fresh's aliasing reaches into pre-bundled npm package internals (likely
    helps other React-ecosystem packages too)
  • Upstream Vite fix if it's fundamentally Vite's pre-bundling behaviour
  • Documented Fresh workaround (e.g. esbuild rebundle of Player with
    react → preact/compat at bundle time, served from static/)
  • First-class Remotion guidance in the Fresh handbook — even just a
    yes/no would help users decide

Happy to open a standalone repro repo, test a patch, or add diagnostics
to the live page if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    react-compatIssues in relation to React compatibilityupstreamThe issue is with an upstream dependency.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions