Skip to content

Conversation

@noalimoy
Copy link
Contributor

@noalimoy noalimoy commented Dec 7, 2025

Summary

Fixes the dashboard Docker build failure causing tsc: not found error when npm skips devDependencies.

Problem

When building the dashboard Docker image in environments where NODE_ENV=production is set (common in CI/CD pipelines), npm ci skips devDependencies by default. This causes the build to fail because TypeScript (tsc) and Vite are listed as devDependencies:

> [frontend-builder 6/6] RUN npm run build:
> semantic-router-dashboard@1.0.0 build
> tsc && vite build

sh: tsc: not found

Root Cause

Environment npm ci behavior Packages installed
Local (no NODE_ENV) Installs all deps 246 packages ✅
CI/CD (NODE_ENV=production) Skips devDependencies 62 packages ❌

Possible Scenarios That Trigger This Bug

This bug can occur when any of the following is true:

  1. Environment variable: NODE_ENV=production is set in the shell

    export NODE_ENV=production
    docker build -t dashboard-test .
  2. npm configuration file: .npmrc contains production=true

    # ~/.npmrc or project/.npmrc
    production=true
  3. CI/CD pipeline: Many CI systems set NODE_ENV=production by default

  4. npm flag: Running with --omit=dev flag

    npm install --omit=dev

Solution

Added --include=dev flag to ensure devDependencies are installed regardless of the NODE_ENV setting.

Files Changed

dashboard/Dockerfile (local development):

- RUN npm ci
+ RUN npm ci --include=dev  # Ensure devDependencies are installed regardless of NODE_ENV

dashboard/backend/Dockerfile (CI/CD):

- RUN npm install
+ RUN npm install --include=dev  # Ensure TypeScript/Vite are installed regardless of NODE_ENV

Why This Is Safe

  • No impact on final image size: This is a multi-stage Docker build. DevDependencies are only installed in the frontend-builder stage and are discarded. Only the compiled dist/ folder is copied to the final image.
  • No security risk: Build tools (TypeScript, Vite) never reach the production image.
  • Minimal build time impact: ~5 seconds additional during build.

Testing

Verified the fix by simulating a production environment:

# Without fix - FAILS
docker build --no-cache -t test . # with ENV NODE_ENV=production in Dockerfile
# Error: sh: tsc: not found

# With fix - PASSES
docker build --no-cache -t test . # with --include=dev flag
# ✓ built in 2.29s

Checklist

  • Reproduced the issue locally (simulated NODE_ENV=production)
  • Fix verified - Docker build passes with NODE_ENV=production
  • No impact on final Docker image size (multi-stage build)
  • docker build -t dashboard-test . passes locally

Related Issues

Closes #752

@netlify
Copy link

netlify bot commented Dec 7, 2025

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 47c94eb
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/6936c640a32cbc0008b8896a
😎 Deploy Preview https://deploy-preview-780--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

👥 vLLM Semantic Team Notification

The following members have been identified for the changed files in this PR and have been automatically assigned:

📁 dashboard

Owners: @JaredforReal, @Xunzhuo
Files changed:

  • dashboard/Dockerfile
  • dashboard/backend/Dockerfile

vLLM

🎉 Thanks for your contributions!

This comment was automatically generated based on the OWNER files in the repository.

When NODE_ENV=production is set (common in CI environments), npm ci
skips devDependencies by default. This causes the build to fail with
"tsc: not found" because TypeScript is listed as a devDependency.

Adding --include=dev ensures TypeScript, Vite, and other build tools
are always installed regardless of environment configuration.

This has no impact on the final image size since devDependencies are
only used in the build stage and discarded in the multi-stage build.

Fixes vllm-project#752

Signed-off-by: Noa Limoy <nlimoy@nlimoy-thinkpadp1gen7.raanaii.csb>
@noalimoy noalimoy force-pushed the bugfix/dashboard_docker_tsc_command_752 branch from e4a1f17 to c1dcdb5 Compare December 7, 2025 13:42
@rootfs rootfs merged commit 588ab7a into vllm-project:main Dec 8, 2025
25 checks passed
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: Dashboard Docker build fails due to missing tsc command

4 participants