Skip to content

Commit a9c0159

Browse files
edmundhungpenalosa
andauthored
fix(vitest-pool-workers): improve error message with isolated storage (#8173)
Co-authored-by: Somhairle MacLeòid <[email protected]>
1 parent fce642d commit a9c0159

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.changeset/red-rockets-lie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/vitest-pool-workers": patch
3+
---
4+
5+
improve error message with isolated storage

packages/vitest-pool-workers/src/pool/loopback.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,10 @@ function checkAllStorageOperationsResolved(
326326
"",
327327
separator,
328328
`Failed to ${action} isolated storage stack frame in ${source}.`,
329-
"This usually means your Worker tried to access storage outside of a test, or failed to cleanup storage passed across an RPC boundary.",
330-
`In particular, we were unable to ${action} ${LIST_FORMAT.format(
331-
failedProducts
332-
)} storage.`,
333-
"Ensure you `await` all `Promise`s that read or write to these services, and make sure you use the `using` keyword when passing data across JSRPC. See https://developers.cloudflare.com/workers/runtime-apis/rpc/lifecycle#explicit-resource-management for more details.",
329+
`In particular, we were unable to ${action} ${LIST_FORMAT.format(failedProducts)} storage.`,
330+
"This usually means your Worker tried to access storage outside of a test, or some resources have not been disposed of properly.",
331+
`Ensure you "await" all Promises that read or write to these services, and make sure you use the "using" keyword when passing data across JSRPC.`,
332+
`See https://developers.cloudflare.com/workers/testing/vitest-integration/known-issues/#isolated-storage for more details.`,
334333
"\x1b[2m"
335334
);
336335
lines.push("\x1b[22m" + separator, "");

0 commit comments

Comments
 (0)