Try adding the `rpc` compatibility flag

Try adding the rpc compatibility flag into your Wrangler.json
11 Replies
jman
jman•5mo ago
The compatibility flag rpc became the default as of 2024-04-03 so does not need to be specified anymore. But it did change the error that was sent, let me read through it
jman
jman•5mo ago
Hmm, it's a large error so I've attached it. I don't see much substance in it though: Vitest caught 1 unhandled error during the test run. -- The Workers runtime failed to start. There is likely additional logging output above. -- { code: 'ERR_RUNTIME_FAILURE' }
kian
kian•5mo ago
Might be a lack of RPC support at all in the Vitest environment currently https://github.com/cloudflare/workers-sdk/issues/5386 refers to https://github.com/cloudflare/workers-sdk/pull/5508 which isn't merged yet
This wrapping will need to be updated for JSRPC. In particular, we need to make sure RPC methods can still be called on WorkerEntrypoint default exports, and DurableObject subclasses
jman
jman•5mo ago
Darn, that's a shame... Thanks for finding that Installing the PR is still causing the same errors, so doesn't look like it's totally resolved yet
kian
kian•5mo ago
As in checking out the PR and building vitest-pool-workers yourself?
jman
jman•5mo ago
No I was using the prerelease in the github actions bot message Oh that message only includes wrangler
kian
kian•5mo ago
If you expand the 'additional artifacts' there should be a Vitest one (which I wasn't aware of until I checked with someone else)
jman
jman•5mo ago
WOAH it works 🙂 Thanks @kian !
kian
kian•5mo ago
Credit to @James, I spent all this time trying to build it myself since I didn't think there was prereleases for Vitest :notlikemeow:
jman
jman•5mo ago
I did exactly the same lol
James
James•5mo ago
Hah yeah it's tucked under that little section there. I only knew because of early testing. Glad you were able to use it! 😄
Want results from more Discord servers?
Add your server