Skip to content

ci: check the first request after a cold nuxt dev - #1500

Merged
larbish merged 1 commit into
mainfrom
ci/dev-first-request-test
Nov 25, 2026
Merged

larbish merged 1 commit into
mainfrom
ci/dev-first-request-test

Conversation

@larbish

@larbish larbish commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Why

A cold nuxt dev could leave the first request hanging: nuxt-og-image 7.0.7 rebuilt Nitro right after "Ready", and Nitro 2 drops the requests in flight when it swaps its dev worker. The nuxt-og-image 7.2.0 bump in #1498 fixed it, but nothing in CI would catch a rebuild like this coming back from any module.

What changed

  • Add test/dev/first-request.test.ts: it cold-starts nuxt dev on the playground, requests / 3 s after "Ready", and expects one Nitro build and a 200 within 30 s.
  • Add a dev Vitest project and a test:dev script.
  • Run pnpm run test:dev in the build CI job, after the unit tests.

Evidence

CI=true pnpm run test:dev

Before (nuxt-og-image 7.0.7, on c020e49)

AssertionError: Nitro dev server builds: expected 2 to be 1 // Object.is equality
AssertionError: first request: expected 'TimeoutError' to be 200 // Object.is equality
      Tests  1 failed (1)

After (main, nuxt-og-image 7.2.0)

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Duration  24.49s (tests 100%)

Notes

  • The test clears Vitest's NODE_ENV, TEST and VITEST* variables for the nuxt dev process. With them, Nuxt and Nitro run in test mode, hide their build logs, and the test passed on the broken version.
  • It deletes playground/.nuxt and playground/node_modules/.cache for a cold start, which adds about 25 s to the build job.
  • It fails on any second Nitro build during startup, not only this one, because in Nitro 2 any rebuild drops requests in flight.
  • Not run on a GitHub runner yet. The build-count check does not depend on timing.

ELI5

Starting the docs site locally sometimes left the first page loading forever, because a plugin restarted the server just after startup. A dependency update fixed it. This adds a test that starts the site the same way and fails if the server restarts or the first page doesn't load.

🤖 Generated with Amp, reviewed by @larbish before opening.

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docus Ready Ready Preview Nov 25, 2026 2:51pm UTC

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-docus@1500
npm i https://pkg.pr.new/docus@1500

commit: 03e161a

@docus-bundle-report

Copy link
Copy Markdown

Bundle size

Explore the comparison →

Client 774.4 kB (no change) · Server 1.59 MB $\color{green}\textsf{(-160 B, -0.0}\%\textsf{)}$

No route loads 100 B more or less before it renders.

No prerendered URL's initial load or HTML changes by 100 B or more.

Brotli sizes. Changes under 100 B are left out of the tables. Measured by nuxt-bundle-analyzer for 03e161a.

@larbish
larbish merged commit f5927ca into main Nov 25, 2026
12 checks passed
@larbish
larbish deleted the ci/dev-first-request-test branch November 25, 2026 14:57

This branch was successfully deployed

1 active deployment
Preview — 03e161ab Deployed Nov 25, 2026 by vercel[bot]
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.

1 participant