Which Cloudflare product(s) does this pertain to?
Workers Vitest integration (@cloudflare/vitest-pool-workers)
Versions
@cloudflare/vitest-pool-workers: 0.18.4
wrangler: 4.110.0
- bundled
miniflare: 4.20260708.1
vitest: 4.1.8
- Node.js: 24.18.0
What is the problem?
cloudflareTest() accepts miniflare.unsafeDevRegistryPath, but the pool drops that option before constructing the project Miniflare instance. A service binding intended to resolve a separately running local Worker through Wrangler's dev registry therefore cannot resolve.
Minimal configuration shape:
cloudflareTest({
remoteBindings: false,
wrangler: {
configPath: './wrangler.jsonc',
environment: undefined
},
miniflare: {
unsafeDevRegistryPath: registryPath,
serviceBindings: {
AI_SERVICE: 'ai'
}
}
});
With a local Worker named ai registered in registryPath, the test Worker fails to start:
Worker "core:user:vitest-pool-workers-runner-"'s binding "AI_SERVICE"
refers to a service "core:user:ai", but no such service is defined.
If the option is manually forwarded by the pool, Miniflare instead creates the dev-registry proxy and resolves the binding through the configured registry as expected.
Root cause
parseCustomPoolOptions() parses the Miniflare options, but buildProjectMiniflareOptions() builds a new object from SHARED_MINIFLARE_OPTIONS and selected pool fields. unsafeDevRegistryPath is not preserved or forwarded.
Proposed fix
Preserve options.miniflare.unsafeDevRegistryPath during custom option parsing and include it in the object returned by buildProjectMiniflareOptions(). The pool's internal WorkersPoolOptionsWithDefines type also needs to carry the option.
Conceptually:
const unsafeDevRegistryPath = options.miniflare.unsafeDevRegistryPath;
// ...
options.unsafeDevRegistryPath = unsafeDevRegistryPath;
return {
...SHARED_MINIFLARE_OPTIONS,
...(customOptions.unsafeDevRegistryPath === undefined
? {}
: { unsafeDevRegistryPath: customOptions.unsafeDevRegistryPath }),
// ...
};
I can prepare an upstream PR if this is an accepted supported use of the Vitest pool.
Which Cloudflare product(s) does this pertain to?
Workers Vitest integration (
@cloudflare/vitest-pool-workers)Versions
@cloudflare/vitest-pool-workers: 0.18.4wrangler: 4.110.0miniflare: 4.20260708.1vitest: 4.1.8What is the problem?
cloudflareTest()acceptsminiflare.unsafeDevRegistryPath, but the pool drops that option before constructing the project Miniflare instance. A service binding intended to resolve a separately running local Worker through Wrangler's dev registry therefore cannot resolve.Minimal configuration shape:
With a local Worker named
airegistered inregistryPath, the test Worker fails to start:If the option is manually forwarded by the pool, Miniflare instead creates the dev-registry proxy and resolves the binding through the configured registry as expected.
Root cause
parseCustomPoolOptions()parses the Miniflare options, butbuildProjectMiniflareOptions()builds a new object fromSHARED_MINIFLARE_OPTIONSand selected pool fields.unsafeDevRegistryPathis not preserved or forwarded.Proposed fix
Preserve
options.miniflare.unsafeDevRegistryPathduring custom option parsing and include it in the object returned bybuildProjectMiniflareOptions(). The pool's internalWorkersPoolOptionsWithDefinestype also needs to carry the option.Conceptually:
I can prepare an upstream PR if this is an accepted supported use of the Vitest pool.