fix(dashboard): next-env.d.ts missing in fresh checkout + CVE-2025-66478 #3

Merged
mikan merged 1 commits from fix/dashboard-build-and-cve into master 2026-10-23 23:12:43 +00:00
Collaborator

Root cause of build failure

next-env.d.ts — это auto-generated файл, который Next.js создаёт при первом next dev / next build. По конвенции Next.js он в .gitignore (чтобы не закоммитить локальные типы).

На свежем git checkout — например, когда dashboard image собирается внутри ssh-main контейнера после git pull — этого файла нет.

В Dockerfile было:

COPY tsconfig.json next.config.ts next-env.d.ts postcss.config.mjs .eslintrc.json ./

Legacy Docker builder (без BuildKit) падает с:

COPY failed: file not found in build context or excluded by .dockerignore:
stat next-env.d.ts: file does not exist

Фикс

  • Убрал next-env.d.ts из строки COPY
  • Добавил RUN touch next-env.d.ts перед билдом — next build перезапишет его правильным содержимым
  • Убрал .eslintrc.json из .dockerignore — он исключался, но нужен в COPY в Dockerfile
# Было:
COPY tsconfig.json next.config.ts next-env.d.ts postcss.config.mjs .eslintrc.json ./

# Стало:
RUN touch next-env.d.ts
COPY tsconfig.json next.config.ts postcss.config.mjs .eslintrc.json ./

Security: CVE-2025-66478

next@16.0.0 имеет security vulnerability (CVE-2025-66478 — см. https://nextjs.org/blog/CVE-2025-66478). npm warn об этом появлялся в build логах:

npm warn deprecated next@16.0.0: This version has a security vulnerability.
Please upgrade to a patched version.

Поднял версии:

  • next: 16.0.0 → 16.4.3 (latest stable)
  • eslint-config-next: 16.0.0 → 16.4.3

16.4.3 — последний стабильный релиз, полностью backward-compatible с существующим стеком (React 19 + TypeScript 5 + Tailwind 4 + Radix UI).

Верификация

  • Clean build с нуля: rm -rf node_modules .next next-env.d.ts && npm install && npm run build
  • npm install — OK, 406 пакетов, нет deprecation warnings про next
  • npm run build — OK, все 17 роутов сгенерированы (1 page + 1 not-found + 15 API routes)
  • Standalone output на месте: .next/standalone/server.js + .next/static/

Files changed

  • dashboard/Dockerfile — убрал next-env.d.ts из COPY, добавил RUN touch
  • dashboard/.dockerignore — убрал .eslintrc.json из исключений
  • dashboard/package.json — bumped next + eslint-config-next до 16.4.3
  • dashboard/package-lock.json — regenerated
## Root cause of build failure `next-env.d.ts` — это auto-generated файл, который Next.js создаёт при первом `next dev` / `next build`. По конвенции Next.js он в `.gitignore` (чтобы не закоммитить локальные типы). На свежем git checkout — например, когда dashboard image собирается внутри ssh-main контейнера после `git pull` — этого файла **нет**. В Dockerfile было: ```dockerfile COPY tsconfig.json next.config.ts next-env.d.ts postcss.config.mjs .eslintrc.json ./ ``` Legacy Docker builder (без BuildKit) падает с: ``` COPY failed: file not found in build context or excluded by .dockerignore: stat next-env.d.ts: file does not exist ``` ## Фикс - Убрал `next-env.d.ts` из строки COPY - Добавил `RUN touch next-env.d.ts` перед билдом — `next build` перезапишет его правильным содержимым - Убрал `.eslintrc.json` из `.dockerignore` — он исключался, но нужен в COPY в Dockerfile ```dockerfile # Было: COPY tsconfig.json next.config.ts next-env.d.ts postcss.config.mjs .eslintrc.json ./ # Стало: RUN touch next-env.d.ts COPY tsconfig.json next.config.ts postcss.config.mjs .eslintrc.json ./ ``` ## Security: CVE-2025-66478 `next@16.0.0` имеет security vulnerability (CVE-2025-66478 — см. https://nextjs.org/blog/CVE-2025-66478). npm warn об этом появлялся в build логах: ``` npm warn deprecated next@16.0.0: This version has a security vulnerability. Please upgrade to a patched version. ``` Поднял версии: - `next`: 16.0.0 → **16.4.3** (latest stable) - `eslint-config-next`: 16.0.0 → 16.4.3 16.4.3 — последний стабильный релиз, полностью backward-compatible с существующим стеком (React 19 + TypeScript 5 + Tailwind 4 + Radix UI). ## Верификация - Clean build с нуля: `rm -rf node_modules .next next-env.d.ts && npm install && npm run build` - `npm install` — OK, 406 пакетов, **нет deprecation warnings про next** - `npm run build` — OK, все 17 роутов сгенерированы (1 page + 1 not-found + 15 API routes) - Standalone output на месте: `.next/standalone/server.js` + `.next/static/` ## Files changed - `dashboard/Dockerfile` — убрал `next-env.d.ts` из COPY, добавил `RUN touch` - `dashboard/.dockerignore` — убрал `.eslintrc.json` из исключений - `dashboard/package.json` — bumped next + eslint-config-next до 16.4.3 - `dashboard/package-lock.json` — regenerated
super-z-bot added 1 commit 2026-10-23 23:04:51 +00:00
## Root cause of build failure

`next-env.d.ts` is auto-generated by Next.js on first dev/build run and is
gitignored (per Next.js convention). On a fresh git checkout — e.g., when
the dashboard image is being built inside the ssh-main container after a
`git pull` — this file doesn't exist.

The Dockerfile had:
  COPY tsconfig.json next.config.ts next-env.d.ts postcss.config.mjs .eslintrc.json ./

Legacy Docker builder (no BuildKit) errors out:
  COPY failed: file not found in build context or excluded by .dockerignore:
  stat next-env.d.ts: file does not exist

## Fix

- Removed `next-env.d.ts` from the COPY line
- Added `RUN touch next-env.d.ts` before the build step (Next.js will
  overwrite it with correct content during `npm run build`)
- Removed `.eslintrc.json` from `.dockerignore` (it was being excluded
  but is needed by the COPY in Dockerfile)

## Security: CVE-2025-66478

`next@16.0.0` has a security vulnerability (CVE-2025-66478). Bumped:
  - next: 16.0.0 -> 16.4.3 (latest stable)
  - eslint-config-next: 16.0.0 -> 16.4.3

16.4.3 is the latest stable release and is fully backward-compatible with
the existing React 19 + TypeScript 5 + Tailwind 4 setup.

## Verified

- Clean build from scratch (rm -rf node_modules .next next-env.d.ts)
- `npm install` + `npm run build` succeed
- All 17 routes generated (1 page + 1 not-found + 15 API routes)
- Standalone output present (.next/standalone/server.js + .next/static)
mikan merged commit fb7129acea into master 2026-10-23 23:12:43 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mikan/GPU-Node#3