-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: vitest-pool-workers node compatibility with the jose and prisma libraries #5127
Comments
Hey! 👋 |
Great work @mrbbot! I'm excited to try it once it's out 💓 |
Hey! 👋 The new pre-release should be ready: // vitest.config.ts
import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";
export default defineWorkersConfig({
test: {
poolOptions: {
workers: {
isolatedStorage: true,
wrangler: {
configPath: "./wrangler.toml"
}
},
},
},
}); https://github.com/mrbbot/vitest-pool-workers-prerelease-getting-started has been updated with the new pre-release. You can also find a bunch of examples here: https://github.com/cloudflare/workers-sdk/tree/bcoll/vitest-pool-workers-examples/fixtures/vitest-pool-workers-examples. |
@mrbbot the new release fixed the I'm still seeing this Prisma import failure error however:
I reproduced it here and added a CI workflow for easy testing: https://github.com/vladinator1000/prisma-vitest-miniflare Importing something from Looking at the files, they just do some re-exports // @prisma/client
export * from '.prisma/client/default' // .prisma/client/default
export * from './index' I double-checked that I'm running |
Hey! 👋 Did some more digging into why Prisma doesn't work, and uncovered a whole bunch of issues. 😅 Thanks for testing this early! Issue 1:
|
#5070 includes fixes for |
Woah @mrbbot, that's some great detective work! I'll keep updating my test repo when there are new developments 🙌🏼 |
Hi @mrbbot, I gave this another whirl now that Prisma 5.12.1 officially supports D1. I found a new error. Looks like it relates to wasm resolution. It happens after you start querying the client:
Here's the reproduction repo: https://github.com/vladinator1000/prisma-vitest-miniflare/tree/27410822df6161c2d97006352fe74dbd0692e90e Failing CI run: https://github.com/vladinator1000/prisma-vitest-miniflare/actions/runs/8733836366/job/23963290162 By the way, I was following the new vitest-pool-workers docs and they are amazing! 🎉 I absolutely love the new experience. It blows my mind that I can just |
We can close this now that prisma/prisma#23911 is done 🥳 |
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.30.1
What version of Node are you using?
v21.6.1
What operating system and version are you using?
Windows 11
Describe the Bug
Observed behavior
When I run the tests in my repro
I observe this error
The jose library actually works in the production runtime of Cloudflare workers, without the
nodejs_compat
flag, butvitest-pool-workers
paradoxically requires the flag.Expected behavior
The tests work.
Steps to reproduce
Clone https://github.com/vladinator1000/miniflare-node-compat-bug
Run
Please provide a link to a minimal reproduction
https://github.com/vladinator1000/miniflare-node-compat-bug
Please provide any relevant error logs
I also found a similar issue when using Prisma: prisma/prisma#23193 (comment)
The text was updated successfully, but these errors were encountered: