Skip to content

Conversation

@R-Delfino95
Copy link
Contributor

@R-Delfino95 R-Delfino95 commented Jan 9, 2026

Summary

Fixes #364 by ensuring DEV_MODE correctly evaluates NODE_ENV at runtime instead of being hardcoded during the build process.

Previously, esbuild was replacing process.env.NODE_ENV === 'development' with true during the NPM build, causing the "Upload in progress…" alert to be rendered in the DOM even in production environments. Although the alert was visually hidden, the text was still present in the markup, which could lead to SEO and accessibility issues.


Changes

  • Added isDevMode() helper function in src/components/utils.ts that uses indirect access to process.env.NODE_ENV to prevent bundlers from replacing it at build time
  • Updated src/components/video.tsx to use isDevMode() instead of directly checking process.env.NODE_ENV
  • The Alert component now correctly respects the runtime NODE_ENV value, only appearing in actual development environments

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
next-video-demo Ready Ready Preview, Comment Jan 9, 2026 3:42pm

@snyk-io
Copy link

snyk-io bot commented Jan 9, 2026

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

Status Scanner 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.

@R-Delfino95 R-Delfino95 marked this pull request as ready for review January 9, 2026 19:30
@R-Delfino95 R-Delfino95 requested a review from luwes January 9, 2026 19:30
Copy link
Collaborator

@luwes luwes left a comment

Choose a reason for hiding this comment

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

Can we change the approach to what was intended by having esbuild not replace process.env.NODE_ENV? So the end user automatically gets the right mode when it has process.env.NODE_ENV set...

Added isDevMode method to get the environment avoiding esbuild to replace the value
@vercel
Copy link

vercel bot commented Jan 14, 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.

@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.32%. Comparing base (7a6951a) to head (d915765).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #410      +/-   ##
==========================================
- Coverage   86.35%   86.32%   -0.03%     
==========================================
  Files          37       37              
  Lines        3202     3211       +9     
  Branches      425      425              
==========================================
+ Hits         2765     2772       +7     
- Misses        435      437       +2     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@R-Delfino95 R-Delfino95 requested a review from luwes January 14, 2026 20:20
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.

"Upload in progress…" is hidden by CSS but still in the DOM

4 participants