Skip to content

Commit 952e560

Browse files
zechu-cfgreg-mckeondeadlypants1973
authored
[Workers - Durable Objects] Add Troubleshooting section (#1726)
* adding Durable Objects troubleshooting * improve clarity * Update using-durable-objects.md * Update products/workers/src/content/learning/using-durable-objects.md Co-authored-by: Kate Tungusova <[email protected]> Co-authored-by: Greg McKeon <[email protected]> Co-authored-by: Kate Tungusova <[email protected]>
1 parent 51b6845 commit 952e560

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

products/workers/src/content/learning/using-durable-objects.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,3 +434,17 @@ export class Counter {
434434
## Configuration Script
435435

436436
While using Wrangler is strongly recommended, if you would really rather not use it for some reason we've included a [shell script](/publish-durable-object.sh) to automate the curl commands involved in uploading a Worker that implements and uses Durable Objects.
437+
438+
## Troubleshooting
439+
440+
### Debugging
441+
`wrangler dev` does not currently support Durable Objects.
442+
443+
To help with debugging, you may use [`wrangler tail`](/cli-wrangler/commands#tail) to troubleshoot your Durable Object script. `wrangler tail` displays a live feed of console and exception logs for each request your Worker receives. After doing a `wrangler publish`, you can use `wrangler tail` in the root directory of your Worker project and visit your Worker URL to see console and error logs in your terminal.
444+
445+
### Common errors
446+
#### Error: `No event handlers were registered. This script does nothing.`
447+
In your `wrangler.toml` file, make sure the `dir` and `main` entries point to the correct file containing your Worker script, and that the file extension is `.mjs` instead of `.js` if using ES Modules Syntax.
448+
449+
#### Error when deleting migration
450+
When deleting a migration using `wrangler --delete-class <ClassName>`, you may encounter this error: `"Cannot apply --delete-class migration to class <ClassName> without also removing the binding that references it"`. You should remove the corresponding binding under `[durable_objects]` in `wrangler.toml` before attempting to apply `--delete-class` again.

products/workers/src/content/runtime-apis/durable-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Each method is implicitly wrapped inside a transaction, such that its results ar
8686

8787
- <Code>list()</Code> <Type>Promise&lt;Map&lt;string, any>></Type>
8888

89-
- Returns all keys and values associated with the current Durable Object in ascending lexicographic sorted order. The type of each returned value in the [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) will be whatever was previously written for the corresponding key. Be aware of how much data may be stored in your actor before calling this version of `list` without options, because it will all be loaded into the Durable Object's memory, potentially hitting its [limit](/platform/limits). If that is a concern, pass options to `list` as documented below.
89+
- Returns all keys and values associated with the current Durable Object in ascending lexicographic sorted order. The type of each returned value in the [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) will be whatever was previously written for the corresponding key. Be aware of how much data may be stored in your Durable Object before calling this version of `list` without options, because it will all be loaded into the Durable Object's memory, potentially hitting its [limit](/platform/limits). If that is a concern, pass options to `list` as documented below.
9090

9191
- <Code>list(options<ParamType>Object</ParamType>)</Code> <Type>Promise&lt;Map&lt;string, any>></Type>
9292

0 commit comments

Comments
 (0)