Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 20b7159

Browse files
committed
Add mount check to Durable Object missing script error, closes #221
1 parent 6cbd7bb commit 20b7159

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/durable-objects/src/plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ export class DurableObjectsPlugin
249249
if (!scriptExports) {
250250
throw new DurableObjectError(
251251
"ERR_SCRIPT_NOT_FOUND",
252-
`Script "${scriptName}" for Durable Object "${name}" not found`
252+
`Script "${scriptName}" for Durable Object "${name}" not found.
253+
Make sure "${scriptName}" is mounted so Miniflare knows where to find it.`
253254
);
254255
}
255256
constructor = scriptExports[className];

packages/durable-objects/test/plugin.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ test("DurableObjectPlugin: reload: throws if script cannot be found in mounts",
288288
t.throws(() => plugin.reload({}, {}, new Map()), {
289289
instanceOf: DurableObjectError,
290290
code: "ERR_SCRIPT_NOT_FOUND",
291-
message: 'Script "test" for Durable Object "TEST" not found',
291+
message:
292+
'Script "test" for Durable Object "TEST" not found.\n' +
293+
'Make sure "test" is mounted so Miniflare knows where to find it.',
292294
});
293295
});
294296
test("DurableObjectsPlugin: reload: throws if object constructor cannot be found in mount exports", (t) => {

0 commit comments

Comments
 (0)