Skip to content

fix: resolve TypeScript errors with moduleResolution nodenext and skipLibCheck false#1313

Open
R-Delfino95 wants to merge 10 commits intomuxinc:mainfrom
R-Delfino95:fix/typeScript-errors
Open

fix: resolve TypeScript errors with moduleResolution nodenext and skipLibCheck false#1313
R-Delfino95 wants to merge 10 commits intomuxinc:mainfrom
R-Delfino95:fix/typeScript-errors

Conversation

@R-Delfino95
Copy link
Copy Markdown
Contributor

@R-Delfino95 R-Delfino95 commented Apr 16, 2026

Resolves #1299

  • Vendor mux-embed's type declarations into playback-core/src/vendor/mux-embed.ts. TypeScript compiles this into dist/types/vendor/mux-embed.d.ts and emits a correct relative reference path for consumers.
  • Added a vendor:types npm script (scripts/vendor-mux-embed-types.mjs) that copies the types directly from node_modules/mux-embed/dist/types/mux-embed.d.ts. It's hooked into prebuild:types so it runs automatically on every build — keeping the vendored copy in sync with whatever version of mux-embed is installed.
  • Moved @types/google_interactive_media_ads_types to dependencies in mux-video.
  • Removed the broken /// <reference path> from mux-video/src/ads/index.ts — it's no longer needed since playback-core's vendored reference propagates transitively.

Note

Medium Risk
Medium risk because it changes how @mux/playback-core ships TypeScript declarations (new vendored mux-embed types and a pre-build generation step), which can affect downstream type resolution and builds.

Overview
Fixes NodeNext/skipLibCheck=false TypeScript build failures by vendoring mux-embed type declarations into @mux/playback-core and updating src/types.ts to reference the vendored file instead of node_modules.

Adds a vendor:types script (run automatically via prebuild:types) to copy mux-embed’s .d.ts into src/vendor, and ignores the generated vendor directory in ESLint/Prettier. Also adjusts packaging dependencies: moves @types/google_interactive_media_ads_types to mux-video runtime dependencies, removes an unneeded/broken triple-slash reference in mux-video ads entry, and tweaks a couple dependency version ranges in the lockfile.

Reviewed by Cursor Bugbot for commit 98fe70d. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

@R-Delfino95 is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 16, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@Jerricho93 Jerricho93 self-assigned this Apr 24, 2026
@R-Delfino95 R-Delfino95 marked this pull request as ready for review May 4, 2026 19:06
@R-Delfino95 R-Delfino95 requested a review from a team as a code owner May 4, 2026 19:06
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 289670b. Configure here.

Comment thread packages/playback-core/scripts/vendor-mux-embed-types.mjs
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.

Bug: moduleResolution: "nodenext", incorrect mux-embed and google_interactive_media_ads_types types

2 participants