Skip to content

Hotfix: dashboard Docker build needs @types/node#24

Merged
pulkitpareek18 merged 1 commit into
mainfrom
hotfix-typesnode
May 12, 2026
Merged

Hotfix: dashboard Docker build needs @types/node#24
pulkitpareek18 merged 1 commit into
mainfrom
hotfix-typesnode

Conversation

@pulkitpareek18
Copy link
Copy Markdown
Collaborator

The Deploy workflow on main failed at the Docker dashboard-build stage right after #22 merged. Inside Docker the dashboard workspace is built in isolation, so playwright.config.ts and the test files lost @types/node and tsc errored with TS2591 / TS2304.

This PR is the squashed PR-#22 changes' missing @types/node addition. Verified locally with docker build --target dashboard-build --no-cache reproducing the prod path — passes.

(Branched off main directly rather than dev because PR #22 was squash-merged and dev's old commits no longer apply cleanly.)

The Docker `dashboard-build` stage installs ONLY the dashboard
workspace's deps and runs tsc --noEmit. Locally and in CI's validate
job the dashboard tsc walked UP from dashboard/node_modules to find
the root's @types/node — both workspaces share a parent filesystem.
Inside Docker, /app/dashboard/node_modules is in isolation and there
is no /app/node_modules to walk into, so playwright.config.ts and
the test files erupted with TS2591 ("Cannot find name 'process'")
and TS2304 ("Cannot find name 'global'").

The production deploy on main consequently failed at this exact step
right after the dev → main merge fired the Deploy workflow.

Fix:
- Add @types/node ^20 to dashboard devDependencies (matches the root
  pin so the SDK version is identical).
- Add "node" to dashboard/tsconfig.json compilerOptions.types so the
  explicit types list activates the new install.

Verified locally:
- npm --prefix dashboard run typecheck  → clean
- npm --prefix dashboard run build      → 330 KB / 98 KB gzipped, source maps emitted
- docker build --target dashboard-build → succeeds in isolation,
  reproducing the prod deploy path

The dev branch's CI did not catch this because validate runs both
root + dashboard `npm ci` in the same workspace, so root's
@types/node was always reachable. Long-term gap: add a "build via
Docker" check on dev too. Tracked separately.
Copilot AI review requested due to automatic review settings May 12, 2026 11:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the dashboard’s isolated Docker build by explicitly including Node.js type definitions in the dashboard workspace, resolving TypeScript errors in playwright.config.ts and test files when @types/node isn’t available via hoisting.

Changes:

  • Add @types/node to dashboard devDependencies.
  • Include "node" in dashboard/tsconfig.json "types" so TS picks up Node globals/types during typecheck/build.
  • Update dashboard/package-lock.json to lock @types/node (and undici-types dependency).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
dashboard/tsconfig.json Adds Node types to the TS type inclusion list for dashboard typechecking/build.
dashboard/package.json Adds @types/node to dashboard devDependencies for isolated installs (Docker stage).
dashboard/package-lock.json Locks the new @types/node dependency (and undici-types).
Files not reviewed (1)
  • dashboard/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pulkitpareek18 pulkitpareek18 merged commit bed09ff into main May 12, 2026
6 checks passed
@pulkitpareek18 pulkitpareek18 deleted the hotfix-typesnode branch May 12, 2026 11:46
pulkitpareek18 added a commit that referenced this pull request May 15, 2026
…es (#24)

The Docker `dashboard-build` stage installs ONLY the dashboard
workspace's deps and runs tsc --noEmit. Locally and in CI's validate
job the dashboard tsc walked UP from dashboard/node_modules to find
the root's @types/node — both workspaces share a parent filesystem.
Inside Docker, /app/dashboard/node_modules is in isolation and there
is no /app/node_modules to walk into, so playwright.config.ts and
the test files erupted with TS2591 ("Cannot find name 'process'")
and TS2304 ("Cannot find name 'global'").

The production deploy on main consequently failed at this exact step
right after the dev → main merge fired the Deploy workflow.

Fix:
- Add @types/node ^20 to dashboard devDependencies (matches the root
  pin so the SDK version is identical).
- Add "node" to dashboard/tsconfig.json compilerOptions.types so the
  explicit types list activates the new install.

Verified locally:
- npm --prefix dashboard run typecheck  → clean
- npm --prefix dashboard run build      → 330 KB / 98 KB gzipped, source maps emitted
- docker build --target dashboard-build → succeeds in isolation,
  reproducing the prod deploy path

The dev branch's CI did not catch this because validate runs both
root + dashboard `npm ci` in the same workspace, so root's
@types/node was always reachable. Long-term gap: add a "build via
Docker" check on dev too. Tracked separately.
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.

2 participants