Skip to content

@cloudflare/vitest-pool-workers initialization failure with vitest 4.1.x + miniflare 4.202604xx #13581

@ahwlsqja

Description

@ahwlsqja

Summary

@cloudflare/vitest-pool-workers fails during initialization in our test setup before any tests run.

We originally planned to run a workerd-based integration test for a Cloudflare Worker app, but had to temporarily fall back to a plain Node pool + app.fetch(req, env) approach because the worker pool failed to initialize.

Versions

Observed with combinations around:

  • vitest 4.1.0 / 4.1.x
  • @cloudflare/vitest-pool-workers 0.14.4 through 0.14.7
  • miniflare 4.20260410.0 through 4.20260415.0
  • wrangler 4.61.0

We confirmed the relevant package repository is cloudflare/workers-sdk (packages/vitest-pool-workers).

Symptoms

The failure happens before the actual test body executes.

The errors we observed referenced missing internal Vitest exports such as:

  • @vitest/utils/helpers.filterOutComments
  • @vitest/expect.ChaiStyleAssertions

This suggests a compatibility issue between the worker-pool/miniflare layer and the installed Vitest internals, rather than a bug in our worker application code.

Impact

Because of this, we could not keep the intended workerd-runtime integration test path for our Worker app.

We temporarily replaced it with:

  • Node pool
  • direct app.fetch(new Request(...), env) calls
  • real PostgreSQL test DB
  • mock KV binding

That still lets us validate our route logic and state invariants, but it does not validate:

  • actual workerd runtime behavior
  • binding rendering behavior
  • Hyperdrive runtime behavior inside the worker environment

Question

Is this a known compatibility issue for the vitest 4.1.x + @cloudflare/vitest-pool-workers 0.14.x + miniflare 4.202604xx combination?

If yes, is there an existing tracking issue or recommended workaround?

If helpful, I can provide a minimized reproduction next.

Metadata

Metadata

Labels

awaiting reporter responseNeeds clarification or followup from OPvitestRelating to the Workers Vitest integration

Type

No type
No fields configured for issues without a type.

Projects

Status

Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions