🐛 BUG: Compatibility Issue: nodejs_compat_v2
Flag Causes Errors with Vitest Integration @cloudflare/vitest-pool-workers
#7156
Labels
bug
Something that isn't working
Which Cloudflare product(s) does this pertain to?
Wrangler, Workers Vitest Integration
What version(s) of the tool(s) are you using?
3.84.1 [Wrangler], 2.1.4 [Vitest], 0.5.24 [@cloudflare/vitest-pool-workers], 4.5.1 [yarn], 5.6.3 [typescript]
What version of Node are you using?
20.11.1
What operating system and version are you using?
macOS Sequoia 15.1 (24B83)
Describe the Bug
Describe the Bug
According to Cloudflare's documentation on Node.js compatibility (link), setting the compatibility flag to
nodejs_compat_v2
should enable compatibility behavior equivalent tonodejs_compat
as long as the compatibility date is September 23, 2024, or later. However, usingnodejs_compat_v2
results in compatibility issues with Vitest integration in my project, causing the following error during testing:Error Log
Observed Behavior
When using
nodejs_compat_v2
, Vitest testing fails with acompatibility_flags
error indicating thatnodejs_compat
is required. Switching back tonodejs_compat
resolves this error, but it contradicts the expected functionality stated in the documentation.Expected Behavior
With
nodejs_compat_v2
set as the compatibility flag, tests should pass successfully without requiringnodejs_compat
.Steps to Reproduce
nodejs_compat_v2
inwrangler.toml
with a compatibility date after September 23, 2024.@cloudflare/vitest-pool-workers
.This issue seems to be tied to the interaction between
nodejs_compat_v2
and Vitest's Cloudflare integration package.Please provide a link to a minimal reproduction
https://github.com/ZL-Asica/KumoAuth
Please provide any relevant error logs
The text was updated successfully, but these errors were encountered: