Hey all, I tried to search for solutions

Hey all, I tried to search for solutions to this issue but couldn't find any. I'm running into this error with vitest-pool-workers
FAIL test/index.spec.ts [ test/index.spec.ts ]
TypeError: Cannot use require() to import an ES Module.
❯ Users/arishi/personal/naamdeo-monorepo/node_modules/.pnpm/[email protected]/node_modules/snakecase-keys/index.js?mf_vitest_no_cjs_esm_shim:4:23
FAIL test/index.spec.ts [ test/index.spec.ts ]
TypeError: Cannot use require() to import an ES Module.
❯ Users/arishi/personal/naamdeo-monorepo/node_modules/.pnpm/[email protected]/node_modules/snakecase-keys/index.js?mf_vitest_no_cjs_esm_shim:4:23
I know that the snakecase-keys package is loaded from @clerk/backend. Not sure how to fix it since I need the clerk package in my worker. Are there any solutions to this?
1 Reply
Adi
AdiOP3mo ago
Made a Github issue for this - https://github.com/cloudflare/workers-sdk/issues/6715 Also provided a minimal reproduction repository.
GitHub
🐛 BUG: vitest-pool-workers Cannot use require() to import an ES Mod...
Which Cloudflare product(s) does this pertain to? Workers Vitest Integration What version(s) of the tool(s) are you using? 3.78.2 [wrangler], 0.5.2 [vitest-pool-workers] What version of Node are yo...
Want results from more Discord servers?
Add your server