-
Notifications
You must be signed in to change notification settings - Fork 758
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 can not import Stripe #5592
Comments
Looks like this is #5588 |
With |
I'm still having this problem as well with a dependency that is importing semver and failing with the same error |
I'm having a similar issue with a project that imports FAIL src/test/auth.spec.ts [ src/test/auth.spec.ts ]
Error: No such module "Users/jh/src/workers/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/os".
imported from "Users/jh/src/workers/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/HostDetectorSync.js" edit: Looks like my issue is slightly different: #6581 |
I had solved this a long time ago, I think it was by adding Just a little rant: I am now running a local test environment (ie with some thing similar to `npm run tst) on a side terminal, and instead of SELF.fetch in vitest, I just fetch to localhost:8787. It runs 10 times faster and it never fails with cryptic c++ errors. I even have console.log, imagine that 😆. Vscode extension works, I can upgrade to latest vitest, source lines work as expected, and I don't need to split test files just because vitest pool workers is unreliable and half of the times hangs. I even found a very consistently occuring bug in my code around a postgres deadlock detected exception, which I never realized it existed before switching away from vitest pool workers. Needless to say, this particular issue with Stripe is not even an issue with the approach above.. |
Which Cloudflare product(s) does this pertain to?
Workers Vitest Integration
What version(s) of the tool(s) are you using?
wrangler: ^3.48.0, vitest: 1.3.0, @cloudflare/vitest-pool-workers: ^0.1.17, stripe: ^14.25.0
What version of Node are you using?
v18.18.2
What operating system and version are you using?
Win 11
Describe the Bug
Observed behavior
When importing Stripe, the runner crashes
Expected behavior
No crash
Steps to reproduce
Go to the official SELF recipe
In linked line add the following code (even inside a test, no difference):
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
The text was updated successfully, but these errors were encountered: