Skip to content

fix: throw a clear error when a media asset has no src#129

Open
dazzatronus wants to merge 1 commit into
mainfrom
derk/eng-713-type-check-fails-on-optional-asset-src-in-players-and
Open

fix: throw a clear error when a media asset has no src#129
dazzatronus wants to merge 1 commit into
mainfrom
derk/eng-713-type-check-fails-on-optional-asset-src-in-players-and

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

What

Restore a clean tsc on main. The audio/image/video players and the timeline thumbnail renderer read asset.src directly, but the generated @shotstack/schemas types mark src as optional — so each use was a string | undefined type error (7 in total). A red type-check gate also masks any genuinely new errors.

How

Guard src at each point of use and throw an explicit … asset is missing a 'src' error — consistent with the existing invalid-source handling — which also narrows the type to string. No changes to generated schema types, no !/as assertions.

Behaviour

A media clip whose asset has no src now fails with a clear error instead of building an undefined… URL and failing obscurely. A thumbnail for such a clip falls back to the existing solid-colour state.

Verify

  • tsc --noEmit and tsc --project tsconfig.test.json --noEmit both clean (pushed with the pre-push gate enabled, no bypass).
  • Full unit suite green (1802).

@dazzatronus dazzatronus self-assigned this Jun 24, 2026
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.

1 participant