🐛 BUG: vitest-pool-workers Cannot use r...
Hey all, figured I'd ask here as well, curious if anyone has encountered an issue like this when testing with vitest and how you solved it - https://github.com/cloudflare/workers-sdk/issues/6715
TypeError: Cannot use require() to import an ES Module.
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...
3 Replies
hey @Adi (sorry for the ping). were you able to figure it out? i am facing the same issue and inline
deps
server/deps
are not working eitherHey, yes we worked it out. The issue has the solution in it's comments.
The key think I realised was that I didn't include enough packages in the inline deps array.
Again, the comments outline everything. Hope that helps.
Thankx so much, I got unblocked on this one onto the next error
for someone else who gets stuck on this: -
so i had to add all the related packages
npm ls package-name
(this will list all the related packages, and you need to add in all of em)
thankx again @Adi 🙂