Skip to content

fix(app): copy css.d.ts into Docker builder stage#2625

Open
brandon-pereira wants to merge 2 commits into
mainfrom
brandon/fix-docker-build
Open

fix(app): copy css.d.ts into Docker builder stage#2625
brandon-pereira wants to merge 2 commits into
mainfrom
brandon/fix-docker-build

Conversation

@brandon-pereira

Copy link
Copy Markdown
Member

The production Docker image failed to build after the TypeScript 6 upgrade (#2617) with TS2882: Cannot find module or type declarations for side-effect import of '@mantine/core/styles.css'.

That upgrade added packages/app/css.d.ts (the ambient declare module '*.css' that types side-effect stylesheet imports) and updated the Dockerfile to copy the new mdx.d.ts — but omitted css.d.ts. The builder stage assembles app source from selective COPY statements (src, pages, public, styles, types) that don't include package-root .d.ts files, so css.d.ts never reached the build. Local lint and CI type-checks passed because the file is present there; only the Docker build, with its selective copies, missed it.

Fix: copy css.d.ts into the builder stage alongside mdx.d.ts.

The TypeScript 6 upgrade (#2617) added packages/app/css.d.ts to type
side-effect stylesheet imports (e.g. '@mantine/core/styles.css') and
updated the Dockerfile to copy the new mdx.d.ts, but omitted css.d.ts.

The builder stage assembles app source from selective COPY statements
(src, pages, public, styles, types) that don't include package-root
.d.ts files, so css.d.ts never reached the build and the production
image failed type checking with TS2882. Copy it alongside mdx.d.ts.
@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8acc192

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hyperdx-oss Ignored Ignored Preview Jul 10, 2026 9:04pm
hyperdx-storybook Ignored Ignored Preview Jul 10, 2026 9:04pm

Request Review

@github-actions github-actions Bot added the review/tier-4 Critical — deep review + domain expert sign-off label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔴 Tier 4 — Critical

Touches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD.

Why this tier:

  • Critical-path files (1):
    • docker/hyperdx/Dockerfile

Review process: Deep review from a domain expert. Synchronous walkthrough may be required.
SLA: Schedule synchronous review within 2 business days.

Stats
  • Production files changed: 1
  • Production lines changed: 2
  • Branch: brandon/fix-docker-build
  • Author: brandon-pereira

To override this classification, remove the review/tier-4 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the app Docker production build after the TypeScript upgrade.

  • Copies packages/app/css.d.ts into the Docker builder stage.
  • Keeps the new CSS ambient declarations beside the existing MDX declaration copy.
  • Adds a patch changeset for @hyperdx/app.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
docker/hyperdx/Dockerfile Copies css.d.ts with the app package-root build files so the Docker builder stage can type-check CSS side-effect imports.
.changeset/docker-copy-css-dts.md Adds a patch changeset for the app Docker build fix.

Reviews (2): Last reviewed commit: "chore: shorten changeset to one line" | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

E2E Test Results

All tests passed • 234 passed • 3 skipped • 1578s

Status Count
✅ Passed 234
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

@github-actions

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

The one-line COPY addition is correct and verified end-to-end: css.d.ts lands at /app/packages/app/css.d.ts in the node_base stage, the builder stage (FROM node_base) inherits it, and next build type-checks it because tsconfig.build.json's include glob **/*.ts matches the package-root declaration file. The ambient declare module '*.css' it provides is what resolves the TS2882 failure. The changeset is well-formed (@hyperdx/app matches packages/app/package.json; patch is valid). No other build-required root-level declaration or config file is missing from the COPY list.

🟡 P2 -- recommended

  • docker/hyperdx/Dockerfile:55 -- The production image is built only in release.yml/release-nightly.yml, so drift between this stage's selective package-root COPY list and the files the app build actually needs is never exercised on PRs — which is exactly how this bug reached main.
    • Fix: Add a path-filtered CI step (triggered on changes to docker/hyperdx/Dockerfile or packages/app/*.d.ts) that builds only the builder/type-check stage via docker buildx build --target builder, avoiding a full multi-arch prod build.
    • testing, correctness, project-standards
🔵 P3 nitpicks (1)
  • docker/hyperdx/Dockerfile:55 -- Root-level declaration files are enumerated individually on one long space-separated COPY line, so every future packages/app/*.d.ts must be added manually or be silently dropped from the build.
    • Fix: Consider copying a narrower glob (e.g. the app *.d.ts / *.config.* files) so the intent stays self-maintaining; pre-existing pattern, optional.

Reviewers (4): correctness, testing, maintainability, project-standards.

Testing gaps: No PR-time guard verifies the production Dockerfile's app COPY list stays in sync with package-root files the build needs; this class of regression surfaces only at release/nightly build time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-4 Critical — deep review + domain expert sign-off

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant