Workers SDK Issue Reports

← Back to Dashboard

#7717 Running vitest from C3 default SvelteKit project causes Vite server exit issue

Recommendation:KEEP OPEN
Difficulty:easy
Reasoning:

DX issue: default C3 SvelteKit template produces project where vitest doesn't exit cleanly. Tests pass but warning displayed. Affects out-of-box experience.

Suggested Action:

Investigate default vitest configuration in C3 SvelteKit template

Analysis Report

Issue Review: cloudflare/workers-sdk#7717

Summary

Running vitest from C3-generated SvelteKit project causes "something prevents Vite server from exiting" warning after tests complete.

Findings

  • Created: 2025-01-10
  • Updated: 2025-10-30
  • Version: wrangler 3.99.0, create-cloudflare 2.36.0 -> 4.60.0 / 2.62.3
  • Component: C3, Vitest
  • Labels: bug, vitest
  • Comments: 0

Key Evidence

  • Follows exact Cloudflare SvelteKit quickstart instructions
  • Tests pass but exit with "close timed out after 10000ms" warning
  • Affects default C3 template setup without any custom configuration
  • No reproduction repo but detailed console logs provided showing exact C3 setup flow
  • This is a configuration issue where the default SvelteKit template from C3 produces a project where vitest doesn't exit cleanly
  • Not related to vitest-pool-workers specifically - just standard vitest with SvelteKit
  • No PRs found fixing this
  • Not mentioned in changelogs

Recommendation

Status: KEEP OPEN

Reasoning: This is a valid DX issue affecting the out-of-box experience for users following the official SvelteKit quickstart. While tests pass, the warning about Vite server not exiting is confusing for new users. The issue is with the default template configuration, not vitest-pool-workers itself. This appears to be a SvelteKit adapter or vitest configuration issue in the C3 template.

Action: Investigate the default vitest configuration in C3's SvelteKit template. The issue may be related to how @sveltejs/adapter-cloudflare interacts with vitest, or missing cleanup in the template's vitest config.

Suggested Comment

This appears to be a configuration issue with the default SvelteKit template's vitest setup rather than a vitest-pool-workers bug. The warning suggests there's an unclosed resource or pending async operation after tests complete.

Could you try adding forceRerunTriggers: ['**/package.json'] to your vitest config, or using the --pool=threads flag? Also, are you still experiencing this with the latest create-cloudflare version (2.62.3)?

Notes & Feedback (0)

No notes yet.

Add Note